Guest User

Untitled

a guest
Jul 23rd, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. return this.http.get('http://localhost:3000/words').map((res: Response) => res.json());
  2.  
  3. export class WordsComponent implements OnInit {
  4. words: Word[];
  5. private _productService;
  6.  
  7. constructor(servicio : WordsService, public http: HttpClient) {
  8. this._productService = servicio;
  9. this.words = this._productService.getWords();
  10.  
  11. console.log("Ver words " + JSON.stringify(this._productService.getWords()));
  12.  
  13.  
  14. }
  15.  
  16. ngOnInit(): void {}
  17.  
  18. [
  19. {
  20. "id": 1,
  21. "name": "test",
  22. "translate": "prueba",
  23. "created_at": "2018-06-10T21:15:06.000Z",
  24. "updated_at": "2018-06-10T21:15:06.000Z"
  25. },
  26. {
  27. "id": 2,
  28. "name": "test-one",
  29. "translate": "prueba-uno",
  30. "created_at": "2018-06-10T21:15:22.000Z",
  31. "updated_at": "2018-06-10T21:15:22.000Z"
  32. }]
Add Comment
Please, Sign In to add comment