You need to ng-repeat
within another < ng-repeat
>, to access each array
and print the values:
Html
:
<div ng-app="app">
<div ng-controller="ctrl">
<div ng-repeat="array in arrays">
<div ng-repeat="v in array">
{{v.name}}
</div>
</div>
</div>
</div>
Angular
:
var app = angular.module('app', []);
app.controller('ctrl', ['$scope', function($scope)
{
$scope.arrays = [
[{'name':'a1'}, {'name':'a2'}],
[{'name':'a3'}, {'name':'a4'}]
];
}]);
The arrays
would be the main and array
each internal item.
Example:
var app = angular.module('app', []);
app.controller('ctrl', ['$scope', function($scope)
{
$scope.arrays = [
[{'name':'a1'}, {'name':'a2'}],
[{'name':'a3'}, {'name':'a4'}]
];
}]);
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script><scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div ng-app="app">
<div ng-controller="ctrl">
<div ng-repeat="array in arrays">
<div ng-repeat="v in array">
{{v.name}}
</div>
</div>
</div>
</div>
References: