node package manager
Stop wasting time. Easily manage code sharing in your team. Create a free org »

ng-pourover

ngPourOver

Travis CI   NPM Version

Installation Steps

  • bower install ng-pourover;
  • cd ng-pourover;
  • npm install;
  • node example/server.js (if necessary after npm install);
  • Browse to http://localhost:5001/;

Getting Started

NYTimes' PourOver module allows for quick filtering and sorting.

In the example we are filtering within ~10 milliseconds a 100,000 collection.

Getting started with ngPourOver is fairly straightforward – you first need to add the dependency PourOver into your controller.

$myApp.controller('myController', ['PourOver', function(PourOver) {
 
}]);

You then have everything you need to initialise your collection – assuming your collection is currently stored in the collection variable.

$scope.collection = new PourOver(collection);

If you attempt the aforementioned without adding the poCollection filter – the work-horse of the ngPourOver module, then things won't be pretty. Ensure you've added the poCollection to your template.

<li ng-repeat="model in collection | poCollection">

Logically the next step is to define your first filter on a property – let's say you have a property called name defined in your collection.

$scope.collection.addExactFilter('word');

Afterwards you're able to begin filtering on this property.

$scope.collection.filterBy('word', 'Supercalifragilisticexpialidocious');

You're even able to unfilter all with the unfilter method, and unfilter a specific filter with unfilterBy.

Unit Tests

All of ngPourOver's unit tests are written in Jasmine and can be run with grunt test after you have followed the installation steps above.

Please open a pull request for all commits, and ensure all tests are passing before opening your PR.

Every developer's dream: