Janine Rawnsley
Janine Rawnsley

Reputation: 1258

AngularJS filter not blank

I have seen an answer on how to filter to "not null" but I need to know how to achieve a match on "not blank" instead.

I've tried

 $scope.sortedFieldsFilter = { SortMode: '!' }
 $scope.sortedFieldsFilter = { SortMode: "'!'" }
 $scope.sortedFieldsFilter = { SortMode: !'' }

And every other combination I can think of.

Upvotes: 1

Views: 307

Answers (1)

Paul Lo
Paul Lo

Reputation: 6148

You could use ng-show tag to hide the empty/blank value, the element is shown when the expression evaluates to true, and an empty string will evaluate to false:

<div ng-show="yourVar">{{ yourVar }}</div>

Upvotes: 1

Related Questions