For h1
tag nested ng-repeat
is not working fine.
I know that we can access the parent data in nested ng-repeat
using $parent
. But this is not working for me.
If I replace h1
with div
then this is working fine.
var app = angular.module("myApp", []);
app.controller("myCtrl", function($scope) {
$scope.records = [
"Alfreds Futterkiste",
"Ernst Handel",
]
$scope.records2 = [
"Alfreds Futterkiste2",
"Ernst Handel2",
]
$scope.records3 = [
"Alfreds Futterkiste3",
"Ernst Handel3",
]
});
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<div ng-app="myApp" ng-controller="myCtrl">
<h1 ng-repeat="x in records">
<h1 ng-repeat="y in records2">
<span>{{$parent.x}}</span>
<h1 ng-repeat="z in records3"></h1>
</h1>
</h1>
<div>