Update angular-deckgrid.js to support filtering#88
Update angular-deckgrid.js to support filtering#88andremann wants to merge 1 commit intoakoenig:masterfrom
Conversation
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 Do you have any samples on how to use filters? Please let me know. |
|
Sure! As I wrote in my last message, with my PR I introduced a new attribute to the deckgrid directive called and a few lines below I use such a model for filtering purposes I hope this answers your question. |
|
It should be worth noting that this change would make angular-deckgrid support the standard angular filter, called "filter," and would expect an ng-model as its value (string). It would not allow it to support custom filters. Nice work, though. Simple and clean. |
|
Thanks @kevinclchung ! I kept it simple as my needs were quite straightforward. |
Pull in PR: Update angular-deckgrid.js to support filtering akoenig#88
I proposed a patch adding filtering capabilities to your great directive.
I hope it works fine for you.
As i wrote in a previous message on issue #39
Basically I injected
$filterdependency in the module and used it inin order to filter
sourceattribute by a new directive attribute (calledfilter) for which I registered a new watcherApologies for any inconvenience.. I'm a github newbie..