Does angularjs treates null as $scope.null? -


example question

<div ng-show="bar !== null">hello</div> 

is evaluated in scope as

$scope.bar !== null 

or this?

$scope.bar !== $scope.null 

note in last case, $scope.null undefined , example seem work right.

bonus:

if bar = null happens

// not work (shows hello) <div ng-show="bar !== null">hello</div> 

does not give same result as

// works ok (does not show hello) <div ng-show="bar != null">hello</div> 

why happen?

no, angular recognizes js primitives in expressions, , null among them.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -