How do I properly ng-repeat through nested key value pairs in angularJS

后端 未结 3 1295
独厮守ぢ
独厮守ぢ 2020-12-19 04:25

View live code:

Angular JS

How in the world do I properly loop through nested key value pairs and properly output them like below?

View I want is

3条回答
  •  误落风尘
    2020-12-19 05:02

    So this is pretty old question, however if you modified the object a bit (swap the array types for objects) the following template should work just fine.

    angular.module('init', [])
      .controller('test', ['$scope', function($scope) {
    
        $scope.templates = {
          'touts': {
            'classes': {
              'col-12': {},
              'col-md-12': {},
              'col-lg-12': {}
            }
          }
        };
      }]);
    ul {
      list-style: none;
    }
    
    
    

提交回复
热议问题