angular.js - 關于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’:’本月個人排行’,’text’:’1’,’white’:true,’data’:’['名字','銷售額','排名']’}, {’title’:'本月門店排行',’text’:’1’,’white’:false,’data’:’['名字','銷售額','排名']’}, {’title’:'上月個人排行',’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)了問題如下圖 ,請問各位大神這個問題如何解決呢:(
問題解答
回答1:{’title’:’本月個人排行’,’text’:’1’,’white’:true,’data’:’['名字','銷售額','排名']’},
j.data是一個字符串。。
{’title’:’本月個人排行’,’text’:’1’,’white’:true,’data’:['名字','銷售額','排名']},這樣試試
相關文章:
1. javascript - 在 model里定義的 引用表模型時,model為undefined。2. python3.x - c++調(diào)用python33. css3 - 沒明白盒子的height隨width的變化這段css是怎樣實現(xiàn)的?4. atom開始輸入!然后按tab只有空格出現(xiàn)沒有html格式出現(xiàn)5. css3 - 這個右下角折角用css怎么畫出來?6. javascript - 一個關于客戶端和前端通信的疑惑?7. mysql cant connect to mysql server 3306 偶爾出現(xiàn)這個是什么原因呢8. debian - docker依賴的aufs-tools源碼哪里可以找到啊?9. java - 根據(jù)月份查詢多個表里的內(nèi)容怎么實現(xiàn)好?10. android - 課程表點擊后浮動后邊透明可以左右滑動的界面是什么?
