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. docker gitlab 如何git clone?2. docker容器呢SSH為什么連不通呢?3. docker鏡像push報錯4. macos - mac下docker如何設置代理5. docker start -a dockername 老是卡住,什么情況?6. css - ionic中的柵格布局如何讓文字內容多少不同的每一列中的內容都能垂直居中?7. Docker for Mac 創建的dnsmasq容器連不上/不工作的問題8. angular.js使用$resource服務把數據存入mongodb的問題。9. css3 - 為什么css里面要帶-moz-|-webkit-后又來一個不帶它們的10. docker 下面創建的IMAGE 他們的 ID 一樣?這個是怎么回事????
