我的指令中有控制器和链接,方式如下:
myapp.directive('MyDirective', function(){
return{
restrict: 'A',
transclude: true,
scope: {
....
},
controller: function($scope) {
$scope.variable = true;
},
templateUrl: './app/templates/template.html',
link: function(scope, element, attrs){
scope.$watch('variable ', function(){
console.log("variable : " + scope.variable )
});
}
.....
我无法在块链接中看到scope.variable。我该如何解决?