While working within a loop to retrieve an ID, I attempted to set up another loop as shown below:
<ul ng-show="feed{{raterie.idFB}} === true" ng-init="var myFeed = myFeedFunction(raterie.idFB);">
<li ng-repeat="feed in getFeeder(raterie.idFB) | limitTo:1">adoptions are : {{feed.title | cleanit}}</li>
<li ng-repeat="feed in feeder{{raterie.idFB}} | limitTo:1">adoptions are : {{feed.title | cleanit}}</li>
<li ng-repeat="feed in feeder{raterie.idFB} | limitTo:1">adoptions are : {{feed.title | cleanit}}</li>
<li ng-repeat="feed in feeder[raterie.idFB] | limitTo:1">adoptions are : {{feed.title | cleanit}}</li>
<li ng-repeat="feed in feeder['raterie.idFB'] | limitTo:1">adoptions are : {{feed.title | cleanit}}</li>
<li ng-repeat="feed in myFeed | limitTo:1">adoptions are : {{feed.title | cleanit}}</li>
<li ng-repeat="feed in feeder846097918756247 | limitTo:1">adoptions is : {{feed.title | cleanit}}</li>
<ul>
I am struggling with automatically constructing 'feeder846097918756247'. The last li element is the desired output, but currently I only have one example manually inserted into the first loop.
I have tried two solutions using $scope:
// define the value for ng-repeat (1st solution)
$scope.getFeeder = function(id) {
var idr = 'feeder' + id;
return idr;
}
// define the value for ng-repeat (2nd solution)
function myFeedFunction(pId) {
return eval('feeder' + pId) ;
}
Unfortunately, neither of these solutions seem to work properly.
You can access my online app here: