Home Ask Login Register

Developers Planet

Your answer is one click away!

user1058398 February 2016

AngularJS ignore require if controller not found in directive

I have a directive using the require attribute with as value : '^myCtrl'

Is there anyway I can catch the error thrown if 'myCtrl' isn't found anywhere ?


Omri Aharon February 2016

Not sure about catching the error, but you can make it optional and avoid it altogether:

require: '?^myCtrl'

Post Status

Asked in February 2016
Viewed 1,467 times
Voted 10
Answered 1 times


Leave an answer

Quote of the day: live life