I have seen the following code somewhere in my code but i am not able to find any help on google or anywhere.
app.directive('widget', [function () {
return {
require: '^^dashboard',
There you can see '^^' symbol used in required attribute. I need to understand the purpose.
From the docs :
The myPane directive has a require option with value ^^myTabs. When a directive uses this option, $compile will throw an error unless the specified controller is found. The ^^ prefix means that this directive searches for the controller on its parents. (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.)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.