angular.js - 關于angularjs的ng-repeat 數組問題
問題描述
angular.module('myApp',['myDirective']) .controller('myController',['$scope',function($scope){$scope.data={ 'one':['狀態1','狀態2','狀態3','狀態4'], 'one1':['狀態1','狀態2','狀態3','狀態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>
但是出現了問題如下圖 ,請問各位大神這個問題如何解決呢:(
問題解答
回答1:{’title’:’本月個人排行’,’text’:’1’,’white’:true,’data’:’['名字','銷售額','排名']’},
j.data是一個字符串。。
{’title’:’本月個人排行’,’text’:’1’,’white’:true,’data’:['名字','銷售額','排名']},這樣試試
相關文章:
1. thinkphp3 count()方法必須加上字段?2. python中return 語句與 分支語句連用問題3. mysql 5個left關鍵 然后再用搜索條件 幾千條數據就會卡,如何解決呢4. python - angular route 與 django urls 沖突怎么解決?5. 這是什么情況???6. 微信內網頁上傳圖片問題7. 非root安裝MySQL5.6報錯,求助!!!8. 輸入地址報以下截圖錯誤,怎么辦?9. node.js - nodejs中mysql子查詢返回多行結果怎么處理?10. mysql - 瞬間流量很高的網站,要頻繁的插入數據到數據庫,應該怎么解決這個問題?
