Created
October 24, 2014 22:08
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
var directive = { | |
'li':{ | |
'animal<-animals':{ | |
'span.name': 'animal.name' | |
}, | |
// at the same level of the <- loop declaration | |
// use the keyword: sort | |
sort: function(a, b){ // same kind of sort as the usual Array sort | |
var cmp = function(x, y){ | |
return x > y? 1 : x < y ? -1 : 0; | |
}; | |
return cmp( a.name, b.name ); | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment