Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ERROR Error: StaticInjectorError[CervejaService]:
- StaticInjectorError[CervejaService]:
- NullInjectorError: No provider for CervejaService!
- at _NullInjector.get (core.js:993)
- at resolveToken (core.js:1281)
- at tryResolveToken (core.js:1223)
- at StaticInjector.get (core.js:1094)
- at resolveToken (core.js:1281)
- at tryResolveToken (core.js:1223)
- at StaticInjector.get (core.js:1094)
- at resolveNgModuleDep (core.js:10878)
- at NgModuleRef_.get (core.js:12110)
- at resolveDep (core.js:12608)
- import { Cerveja } from './../core/model';
- import { Injectable } from '@angular/core';
- import { Http } from '@angular/http';
- @Injectable()
- export class CervejaService {
- cervejasUrl = 'http://localhost:8080/cervejas';
- constructor(private http: Http) { }
- adicionar(cerveja: Cerveja): Promise<Cerveja> {
- return this.http.post(this.cervejasUrl,
- JSON.stringify(cerveja))
- .toPromise()
- .then(response => response.json());
- }
- }
Add Comment
Please, Sign In to add comment