For my AngularJS project (v1.2.3), I have a list of routes and am trying to build a navigation bar from the object. What I want to do is display any object with an undefined
module.filter('notNullOrUndefined', [function () {
return function (items, property) {
var arrayToReturn = [];
for (var i = 0; i < items.length; i++) {
var test = property !== undefined ? items[i][property] : items[i];
if (test !== undefined && test !== null) {
arrayToReturn.push(items[i]);
}
}
return arrayToReturn;
};
}]);
Usage:
{{style.name}} Background