html页面中什么是项目列表,Angular 2无法在html页面中显示项目列表

它又是我....我在视图中显示我的项目数组时遇到问题,我总是遇到这个错误.[Unhandled Promise rejection:无法设置未定义的属性'stack'; 区域:; 任务:Promise.then; 值:TypeError:无法设置未定义的属性'stack']

也许我在html视图中绑定数据时做错了.

ngOnInit() : void{

this._loadCoil.getAllCoils().subscribe(coils =>{ this.coils = coils;

this.gridData = {

data: this.coils.slice(this.currentPage, this.currentPage + this.displaySize),

total: this.coils.length};

for(let i = 0; i < this.coils.length; i++){

let isFound = false;

for (let j = 0; j < this.dropDownArray.length; j++){

if (this.dropDownArray[j] == this.coils[i].unit){

isFound = true;

break;

}

}

if(!isFound){

this.dropDownArray.push(this.coils[i].unit);

}

}

});

}

基本上我想用我的数组填充单位名称并在网站上显示它们.(这部分工作正常)

但是,当我想在页面上打印名称时,我得到前面提到的.这是我在html页面中的代码片段

  • {{name}}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值