recherche

Maison  >  Questions et réponses  >  le corps du texte

angulaire.js - À propos du problème du tableau ng-repeat d'Angularjs

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>

Mais il y a un problème comme indiqué ci-dessous. Pourriez-vous s'il vous plaît me dire comment résoudre ce problème : (

黄舟黄舟2819 Il y a quelques jours440

répondre à tous(1)je répondrai

  • 黄舟

    黄舟2017-05-15 17:05:51

    {'title':'Classement personnel ce mois-ci','text':'1','white':true,'data':'["name","sales","ranking"]'} ,

    j.data est une chaîne. .

    {'title':'Classement personnel ce mois-ci','text':'1','white':true,'data':["name","sales","ranking"]},
    Essayez ceci

    répondre
    0
  • Annulerrépondre