当前位置: 移动技术网 > IT编程>脚本编程>AngularJs > angular4中*ngFor不能对返回来的对象进行循环的解决方法

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

2018年09月21日  | 移动技术网IT编程  | 我要评论

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

例如:

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

以上这篇angular4中*ngfor不能对返回来的对象进行循环的解决方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持移动技术网。

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网