Mr.P
Mr.P

Reputation: 45

get scope variable with index angular?

In my controller i have :

$scope['ramData' + [i]] = [
            {"ram":systems[0].server[i].ram}
          ];

How can i get this variable in ngRepeat view ? I tried : {{ramData$index}} but not working.

Upvotes: 1

Views: 1212

Answers (1)

Olexandr  Poplavskyi
Olexandr Poplavskyi

Reputation: 353

Try in the template (this should be inside ng-repeat loop):

{{ $parent['ramData' + $index] }}

Upvotes: 3

Related Questions