我在我的代码中的某处看到了以下代码,但我无法在谷歌或任何地方找到任何帮助。
app.directive('widget', [function () {
return {
require: '^^dashboard',
在那里您可以看到必需属性中使用的“^^”符号。我需要了解目的。
最佳答案
来自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.)
关于javascript - Angular JS指令的return语句中的 '^^'是什么意思,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40989977/