angular.js - 關(guān)于angularjs的ng-repeat 數(shù)組問題
問題描述
angular.module('myApp',['myDirective']) .controller('myController',['$scope',function($scope){$scope.data={ 'one':['狀態(tài)1','狀態(tài)2','狀態(tài)3','狀態(tài)4'], 'one1':['狀態(tài)1','狀態(tài)2','狀態(tài)3','狀態(tài)4'],};$scope.choice='';$scope.choice1='';$scope.pane=[ {’title’:’本月個(gè)人排行’,’text’:’1’,’white’:true,’data’:’['名字','銷售額','排名']’}, {’title’:'本月門店排行',’text’:’1’,’white’:false,’data’:’['名字','銷售額','排名']’}, {’title’:'上月個(gè)人排行',’text’:’1’,’white’:false,’data’:’['名字','銷售額','排名']’}, {’title’:'上月門店排行',’text’:’1’,’white’:false,’data’:’['名字','銷售額','排名']’}]; }]);
<table> <tr ng-repeat='j in pane'><td ng-repeat='x in j.data track by $index'>{{x}}</td> </tr></table>
但是出現(xiàn)了問題如下圖 ,請(qǐng)問各位大神這個(gè)問題如何解決呢:(
問題解答
回答1:{’title’:’本月個(gè)人排行’,’text’:’1’,’white’:true,’data’:’['名字','銷售額','排名']’},
j.data是一個(gè)字符串。。
{’title’:’本月個(gè)人排行’,’text’:’1’,’white’:true,’data’:['名字','銷售額','排名']},這樣試試
相關(guān)文章:
1. 跟著課件一模一樣的操作使用tp6,出現(xiàn)了錯(cuò)誤2. PHP類屬性聲明?3. 微信小程序支持跳轉(zhuǎn)到外部鏈接網(wǎng)頁嗎4. javascript - 安裝了babel,不起作用5. node.js - 初次安裝vue-cli遇到的問題6. angular.js - 這是什么錯(cuò)?誰遇到過?給點(diǎn)提示7. transform - css3 translate 的水平垂直居中問題求解8. css - 這些字體是怎么弄的?9. 前端 - 應(yīng)該先從angularJS , vue.js , react 這些框架中的哪個(gè)開始入手?10. android - 關(guān)于百度定位的問題
