Skip to content

Instantly share code, notes, and snippets.

@beebole
Last active August 29, 2015 14:08
var directive = {
'li':{
'animal<-animals':{
'span.name':'animal.name'
},
// at the same level of the <- loop declaration
// use the keyword: filter
filter:function(a){
// if the name starts with "a" or "A", keep it, returns true
// otherwise, skip it, return false
return ( /^a/i ).test( a.item.name );
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment