How can I get the object length ?
In console my object looks like this:
Object {
2: true,
3: true,
4: true
}
.length
w
You could also use a filter
Edit:
app.filter('objLength', function() {
return function(object) {
return Object.keys(object).length;
}
});
Old Answer:
app.filter('objLength', function() {
return function(object) {
var count = 0;
for(var i in object){
count++;
}
return count;
}
});
And then use it maybe like this
content