我正在使用Google学习ANGULAR 5 CRUD应用程序。 firebase服务和以下视频教程from youtube,我得到了error
ngOnInit() {
var x = this.employeeService.getData();
x.snapshotChanges().subscribe(item => {
this.employeeList = [];
item.forEach(element => {
var y = element.payload.toJSON();
y["$key"] = element.key;
this.employeeList.push(y as Employee);
});
});
}
如何解决?
答案 0 :(得分:0)
尝试
this.employeeList.push(y);