发表于: 2017-06-15 23:13:17
3 933
今天做了啥收获。
做的事情很多,写出来就没多少了
我想渲染页面的时候每次只能渲染出来第一个数据。然后发现这里的后台数据是一个数组。需要遍历整个数组才能完美的渲染
app.filter('change_industry',function(con) {
return function(industrylist) {
for (var i = 0; i < industrylist.length; i++) {
angular.forEach(con.workIndustry,function(item){
if (industrylist[i]==item.type) {
industrylist[i]=item.name
}
});
}
return industrylist
}
});
还有渲染多个数据的时候如果用多个ng-bind会使覆盖。。只能用<td>{{x.city | change_city}}-{{x.county | change_county}}</td>这样的方式来渲染
问题:
这里遇到了比较棘手的问题,请教了很多人 都没有结果。
页面第一次进入的时候整个数据不会渲染出来
但是刷新下这个页面就会完成渲染。
求解
评论