Skip to content

Instantly share code, notes, and snippets.

@kmaida
Last active April 10, 2017 20:45
Show Gist options
  • Save kmaida/781b2b63d75a678124d2 to your computer and use it in GitHub Desktop.
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">
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