AngularJS isDefined() Function to Check if a Value or Reference is Defined inside AngularJS $scope