0
如果我有一個使用的控制器的指令:該指令的使用控制器的指令的多個實例 - 控制器的多個實例?
angular.module("module")
.controller("fooController", ["$scope", function($scope) {
...
})
.directive("foo", function() {
return {
restrict: "E",
controller: "fooController",
link: function($scope, $element, $attrs) {
// Do some things with the scope of the controller here
}
}
})
而且多個實例:
<foo></foo>
<foo></foo>
- 多少控制器的情況下,將產生的呢?
- 它取決於指令是定義新的子還是隔離的範圍?