How can I access the searchStr variable within the anonymous function within the filter
function? Below searchStr prints 0 - n, I guess an iterator for looping through the collection that I am attempting to filter
IEG.vent.on("searchGroups", function (searchStr) {
if (searchStr) {
IEG.Router.navigate("search/" + searchStr);
}
else {
IEG.Router.navigate();
}
var filteredArray = IEG.searchColl.models.filter(function (model,searchStr) {
console.log(model.get("key") + searchStr)
});
});