AngularJS isDefined
function is used to identify if a reference is defined or not. This function return true
if reference is defined.
Syntax
angular.isDefined(value);
<!DOCTYPE html> <html ng-app=""> <head> <!-- www.techstrikers.com --> <title>My first AngularJS code</title> <script SRC="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js"> </script> </head> <body bgcolor="#bnde45"> <fieldset> <legend>AngularJS IsDefined Function</legend> <script> var sourceObj1; var str = "www.techstrikers.com"; document.write(angular.isDefined(sourceObj1)); document.write("</br>"); document.write(angular.isDefined(str)); </script> </fieldset> </body> </html>See Live Example