javascript - How to get the index inside the elements in angular ng-repeat? -


inside ng-repeat elements. how find out index of json passed angular.

<section ng-repeat="member in members">     <h3>{{member.name}}</h3>     <h4 id="">{{member.title}}</h4>     <p class="trim-info" tooltip="{{member.content}}">{{member.content}}</p>     <a href="javascript:void($parent.$index)" ng-click="viewmore()"> ..>>view more</a>     <a href="javascript:void($parent.$index)" ngclick="viewless()">..>>view less</a></p> </section> 

using $index suffice.

<section ng-repeat="member in members">     <h3>{{member.name}}</h3>     <h4 id="">{{member.title}}</h4>     <p class="trim-info" tooltip="{{member.content}}">{{member.content}}</p>     <a href="javascript:void($index)" ng-click="viewmore()"> ..>>view more</a>     <a href="javascript:void($index)" ngclick="viewless()">..>>view less</a></p> </section> 

Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -