File tree 1 file changed +5
-0
lines changed
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -901,6 +901,11 @@ So where does this `myTabs` controller come from? Directives can specify control
901
901
the unsurprisingly named `controller` option. As you can see, the `myTabs` directive uses this
902
902
option. Just like `ngController`, this option attaches a controller to the template of the directive.
903
903
904
+ If it is necessary to reference the controller or any functions bound to the controller's scope in
905
+ the template, you can use the option `controllerAs` to specify the name of the controller as an alias.
906
+ The directive needs to define a scope for this configuration to be used. This is particularly useful
907
+ in the case when the directive is used as a component.
908
+
904
909
Looking back at `myPane`'s definition, notice the last argument in its `link` function: `tabsCtrl`.
905
910
When a directive requires a controller, it receives that controller as the fourth argument of its
906
911
`link` function. Taking advantage of this, `myPane` can call the `addPane` function of `myTabs`.
You can’t perform that action at this time.
0 commit comments