我在一个Angular2服务中有一个函数,它通过Promise.resolve返回模拟数据,当用.then展开时,它会给我一个空的承诺对象。我可以看到,在将调用函数传递到__zone_symbole__value .thenI seem to be left with just an empty promise.之前,调用函数正在接收带有有效负载的承诺Temperature","LowTemper
我正在浏览Angular2的英雄教程和,最近从我的hero.service.ts文件中得到了这个错误:app/hero.service.ts(12,23): error TS1005: '('headers: new Headers({'Content-Type': 'application/json'});
private heroesUrl: 'app/heroes'; //URL to web api</e