Okay! New to AngularJS. Here is my controller code to check if a value is undefined or null.
var configId=$routeParams.confiId;
angular.isUndefinedOrNull = function(configId){ return angular.isUndefined(configId) || configId === null};
if(angular.isUndefinedOrNull) {
alert(configId);
alert("true");
} else {
alert("false");
}
And it always alerts with true.
So I tried alerting configId. If the value is there, it alerts the value otherwise it is alerting undefined. Not going to else part as condition is always true. What is wrong here?
if(angular.isUndefinedOrNull(configId))instead