无法显示数据:Angular 2

时间:2017-04-15 11:19:54

标签: angular

我开始使用angular 2.我正在尝试从json文件中检索数据并将其显示在html页面上,但即使我尝试在控制台中显示它也无法正常工作。

这是我的服务方式:

getScheduleDay (day: string) {
    return this.http.get('http://cfp.devoxx.be/api/conferences/DV16/schedules/'.concat(day))
              .toPromise()
              .then((res: Response) => <Slot[]> res.json().slots)
              .then(slots => { console.log(slots); return slots;});
}

这是组件方法:

getScheduleDay(day: string) {
    this.scheduleListService.getScheduleDay(day);
}

0 个答案:

没有答案