1

I am looking at some AngularJS-based code. It contains the following line:

require: '^wizard',

In this line, what does the circumflex character (^) mean?

This sounds like a question that should be easily answered by a glance into the documentation. Unfortunately, using the search feature on AngularJS.org to look for circumflex does not yield a single hit. Looking directly for ^ returns many results, but at least the first few of them that I checked do not even appear to contain that symbol - hence, I guess the circumflex character is simply ignored in the search. Likewise, when searching directly in Google for angularjs circumflex, I am finding questions on Delphi, encoding problems related to circumflex characters, resources on accented characters, etc.

Community
  • 1
  • 1
O. R. Mapper
  • 20,083
  • 9
  • 69
  • 114

1 Answers1

1

(A ^ prefix would make the directive look for the controller on its own element or its parents; without any prefix, the directive would look on its own element only.)

In here, The directive has a require option with value ^wizard. When a directive uses this option, $compile will throw an error unless the specified controller is found.

Reference: https://docs.angularjs.org/guide/directive

Varit J Patel
  • 3,497
  • 1
  • 13
  • 21