O. R. Mapper
O. R. Mapper

Reputation: 20750

What does a circumflex in a require property mean?

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.

Upvotes: 1

Views: 284

Answers (1)

Varit J Patel
Varit J Patel

Reputation: 3520

(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

Upvotes: 1

Related Questions