angularjs: how to get the index in ng-repeat -


i want implement pagination large ng-repeat, because rendering of 200 objects slow.

i want use bootstrap-ui pagination.

based on selected page calculate object displayed. in ng-repeat have no index. initial plan doesn't work. example:

<div ng-if="index >= min && index <= max">  ... show object... </div> 

can me how solve problem?

thank you!

angularjs provides $index on local scope of each template instance - iterator offset of repeated element (0..length-1). https://docs.angularjs.org/api/ng/directive/ngrepeat

<div ng-repeat="(key, value) in myobj">     <div ng-if="$index >= min && $index <= max">         ... show object...     </div> </div> 

Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -