Answer the question
In order to leave comments, you need to log in
How to check if $scope exists in AngularJS?
When the variable is empty, I cannot catch the error so that I can call the desired function in the else .
if(typeof $scope.formData.telephone == undefined) {
//...
} else {
//...
}
TypeError: Cannot read property 'telephone' of undefined
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question