Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- return this.http.get('http://localhost:3000/words').map((res: Response) => res.json());
- export class WordsComponent implements OnInit {
- words: Word[];
- private _productService;
- constructor(servicio : WordsService, public http: HttpClient) {
- this._productService = servicio;
- this.words = this._productService.getWords();
- console.log("Ver words " + JSON.stringify(this._productService.getWords()));
- }
- ngOnInit(): void {}
- [
- {
- "id": 1,
- "name": "test",
- "translate": "prueba",
- "created_at": "2018-06-10T21:15:06.000Z",
- "updated_at": "2018-06-10T21:15:06.000Z"
- },
- {
- "id": 2,
- "name": "test-one",
- "translate": "prueba-uno",
- "created_at": "2018-06-10T21:15:22.000Z",
- "updated_at": "2018-06-10T21:15:22.000Z"
- }]
Add Comment
Please, Sign In to add comment