ng-repeat: access key and value for each object in array of objects

前端 未结 6 788
清歌不尽
清歌不尽 2020-12-04 15:06

I have an array of objects and I am using an ng-repeat to iterate over them, which is easy. The array looks something like this:

$scope.steps =         


        
6条回答
  •  遥遥无期
    2020-12-04 15:56

    In case this is an option for you, if you put your data into object form it works the way I think you're hoping for:

    $scope.steps = {
     companyName: true,
     businessType: true,
     physicalAddress: true
    };
    

    Here's a fiddle of this: http://jsfiddle.net/zMjVp/

提交回复
热议问题