Nested ng-repeat angularjs

后端 未结 1 1924
隐瞒了意图╮
隐瞒了意图╮ 2021-01-14 13:32

I have an value like that my problem is i don\'t know how much nested that dummy array object so how to use ng-repeat that print all dummy array object

demo:         


        
1条回答
  •  别那么骄傲
    2021-01-14 14:09

    try like this. as this answers: How to put ng-repeat inside ng-repeat for n number of times and How can I make recursive templates in AngularJS when using nested objects?

    var app = angular.module("app",  []);
    
    app.controller('mainCtrl', function($scope){
      $scope.demo = [{
        id: 1,
        dummy: [
            {
                id: 1,
                dummy: [
                    {
                        id: 1,
                        dummy: [
                            {
                                id: 1,
                                 dummy: [
                            {
                                id: 1,
                                 dummy:[]
                            }
                           ]
                            }
                        ]
                    }
                ] 
            }
        ]
    }]
    });
    
    
    
    

    0 讨论(0)
提交回复
热议问题