I am facing a situation where I have to implement nested ng-repeat
. While trying to retrieve the $id
of the first ng-repeat
, there is no issue. However, when attempting to access the $id
of the second ng-repeat
(highlighted in red in the image below), it returns as undefined
.
The structure of my Firebase
looks like this:
https://i.sstatic.net/nmIE7.png
This is the items
object:
https://i.sstatic.net/7CKGZ.png
Below is the HTML code and Controller:
angular
.module('starter')
.controller('feedController', function($scope, $firebaseRef, $firebaseArray) {
$scope.allRequests = $firebaseArray($firebaseRef.requests);
$scope.allRequests.$loaded(function() {
console.log(arguments);
})
})
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<span ng-repeat="items in allRequests">
<!-- This works fine -->
{{items.$id}}
<div ng-repeat="item in items">
<!-- Getting undefined here... -->
{{item.$id}}
</div>
</span>
I am in need of the $id
for the second ng-repeat
. Any assistance on this matter would be highly appreciated.