Skip to content Skip to sidebar Skip to footer

Ng-show Not Working With UnderscoreJS's _.isNull But Works With Val === Null

I've got an element with an ng-show directive and when I use the UnderscoreJS helper function _.isNull it work the same was as using the standard === operator. So this displays the

Solution 1:

Angular expressions are only evaluated against the $scope of that view. So to use underscore in your view you would need to add it to the $scope variable inside your controller:

$scope._ = _;

Now you will be able to use the underscore functions inside expressions.


Post a Comment for "Ng-show Not Working With UnderscoreJS's _.isNull But Works With Val === Null"