Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update angular-deckgrid.js to support filtering #88

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Jun 26, 2015

  1. Update angular-deckgrid.js

    I proposed a patch adding filtering capabilities to your great directive.
    I hope i works fine for you.
    As i wrote in a previous message on issue akoenig#39
    Basically I injected `$filter` dependency in the module and used it in 
    ```javascript
    Deckgrid.prototype.$$createColumns = function $$createColumns () { 
        /*...*/
        angular.forEach($filter('filter')(this.$$scope.model, this.$$scope.filter), function onIteration (card, index) { /*...*/ }
        /*...*/
    }
    ```
    in order to filter `source` attribute by a new directive attribute (called `filter`) for which I registered a new watcher
    ```javascript
    filterWatcher = this.$$scope.$watchCollection('filter', this.$$onModelChange.bind(this));
    this.$$watchers.push(filterWatcher);
    ```
    
    Apologies for any inconvenience.. I'm a github newbie..
    andremann committed Jun 26, 2015
    Configuration menu
    Copy the full SHA
    1f8b806 View commit details
    Browse the repository at this point in the history