How can I get the object length ?
In console my object looks like this:
Object {
2: true,
3: true,
4: true
}
.length
w
Combining some of these answers into
app.filter('numkeys', function() {
return function(object) {
return Object.keys(object).length;
}
});
seems to work
<div ng-show="(furry.animals | numkeys) > 10">lots of furry animals</div>
Even I don't understand why in Angular markup not able to get the value of Objects via 'Object.keys'. But here there's some easy solution. Check it out.