Is there a predefind function to check for null, undefined, or blank variables in angularjs? -


<div  ng-if='documentdata.addresseslist[0] == undefined  ||documentdata.addresseslist[0] == "" || documentdata.addresseslist[0] == null'>      view   </div> 

or other way create user defined function checks these 3 condition in once.

you can use function check wether object defined or not (is null or undefined):

angular.isdefined(value); 

https://docs.angularjs.org/api/ng/function/angular.isdefined

according edit, can use

<div ng-if='documentdata.addresseslist[0]'>view</div> 

in view


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -