Angular 4 - Loopback 2“内部服务器错误”“对象(...)不是函数”

时间:2018-05-12 00:39:13

标签: node.js angular loopback

我不知道为什么会出现这个错误,我按照角色英雄之旅教程

代码:

public productsURL = 'http://localhost:3000/api/productos';  // URL to web api

  constructor(
    private http: HttpClient,
    private messageService: MessageService) { }

  getProducts (): Observable<Product[]> {
    return this.http.get<Product[]>(this.productsURL)
      .pipe(
        tap(products => this.log(`fetched heroes`)),
        catchError(this.handleError('getProducts', []))
      );
  }

https://i.stack.imgur.com/DAQn5.png

0 个答案:

没有答案