Last active
April 10, 2017 20:45
-
-
Save kmaida/781b2b63d75a678124d2 to your computer and use it in GitHub Desktop.
AngularJS - filter for ng-repeat for startFrom; can be used with built in limitTo. Usage: <div ng-repeat="item in items | startFrom:1 | limitTo:items.length-2">
This file contains 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
app.filter('startFrom', function() { | |
return function(input, start) { | |
if (input) { | |
start = +start; // parse to int | |
return input.slice(start); | |
} | |
return []; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment