Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ng-if - checking for null value

I have a loop that runs through a data set and determines the folder setup for a href. I have a ng-if for each of the options but I need to add a check to one of the ng-ifs. I need a way to check if a value is null. I have used something like:

 ng-if="!shortcut.SAM3Link" 

The problem with this is that if a value in my database is not null but does not have a value it does not recognize the difference. I need a way to specifically check for null rather than not having a value.

Basically I need a way to determine between a NULL value in my database and text/blank using a ng-if.

like image 753
Miriam Avatar asked Jan 07 '15 16:01

Miriam


Video Answer


1 Answers

You need to use the Strict Equality Comparison:

ng-if="shortcut.SAM3Link === null"
like image 161
sp00m Avatar answered Sep 20 '22 00:09

sp00m