I suggest that this function be your controller:
$scope.isEmpty = function(value){
return (value == "" || value == null);
};
And your HTML:
<div ng-if="!isEmpty(data.variable)">something else</div>
If this feature is useful on many of your pages, I suggest you put it on $ rootScope so that it is recognized throughout the application.
source
share