I have the following array declared in my JavaScript file
var myApp = angular.module('myApp',[]);
function MyCtrl($scope) {
$scope.name = 'Superhero';
$scope.tempArr = [
["block A1", "block B1", "block C1"],
["block A2", "block B2", "block C2"]
];
}
Now, in Angular, I want to loop through this array and display the result like
block A1 block B1 block C1
block A2 block B2 block C2
I tried to achieve this by:
<div ng-controller="MyCtrl">
<div>
<div ng-repeat="row in tempArr">
<input type="text" value="{{row[$index]}}">
<input type="text" value="{{row[$index+1]}}">
<input type="text" value="{{row[$index+2]}}">
</div>
</div>
</div>
But it doesn't display "block A2". How can I fix this problem?