Created
May 22, 2015 14:49
-
-
Save linus-amg/5795aabcd9c19ef2d771 to your computer and use it in GitHub Desktop.
users
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
class Collection extends Backbone.Collection | |
model: User | |
query: (query) -> | |
query = new RegExp query, 'gi' | |
filtered = @filter (item) -> | |
state = !!item.attributes.details.firstName.match(query) | |
return state | |
return new Collection filtered |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment