/ Published in: JavaScript
Find an object in a collection with underscore. Using the filter function from underscore.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
initialize : function() { this.folders = new FolderCollection(); }, analize : function(event){ var selected = _.filter(this.folders, function(num) { return num.attributes.name == event; }); console.log(selected); }, .....