当前位置:主页 > 网页前端 > AngularJS >

angular4中*ngFor不能对返回来的对象进行循环的解决方法

时间:2021-06-23 09:19:51 | 栏目:AngularJS | 点击:

解决方法:可以循环返回的对象,得到对象里每一个key所对应的值,然后把值放到自己定义的一个数组中。

例如:

tipAttr: any = [];
$.each(response.ipCustomer.tip, function(key, val) {
  console.log(val);
  self.tipAttr.push(val);
  return self.tipAttr;
  });

您可能感兴趣的文章:

相关文章