Saturday, 28 May 2016

Anjularjs : ng-repeat, index & parentIndex of an array

Angulajs  : ng-repeat, index parentindex

                    ng-repeate is a anjular directive help to iterate the items of an array.


Index : 
        $index is help us to access index of item in that collection.

Expressions are : 

Index = {{ $index}}
Parentindex={{$parent.$index}}----current parent item index in array.
ng-init=”parentindex=$index”->get current item index is initialized as  parentindex variable.

No comments:

Post a Comment