I have a problem when the attribute of the object does not exist and I can not filter using "!null", I wonder if filter can validate this or i need to create a new filter for this.
Html ng-repeat
<li ng-repeat="detail in details | filter:{shortDescription: '!null'}">
<p>{{detail.name}}</p>
</li>
JavaScript Array
$scope.details = [{
name: 'Bill',
shortDescription: null
},{
name: 'Bill2',
}, {
name: 'Sally',
shortDescription: 'A girl'
}];
Result
- Bill2
- Sally
Bill2 have no exist shortDescription but not filter.
expected Result:
- Sally
JSFiddle http://jsfiddle.net/4wxs67yv/28/
AngularJS v.1.3.15
How i can do this?