-
-
Save maheshbabu/b9cefb6c2732382f585a9ee02497705e to your computer and use it in GitHub Desktop.
Simple load more function for ng-repeat with limitTo filter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// set the default amount of items being displayed | |
$scope.limit= 5; | |
// loadMore function | |
$scope.loadMore = function() { | |
$scope.limit = $scope.items.length | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul class="lists"> | |
<li ng-repeat="item in items | limitTo:limit"> | |
<span>{{item.name}}</span> | |
</li> | |
<li> | |
<button ng-click='loadMore()'>Load More</button> | |
</li> | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment