提问人:user880386 提问时间:6/26/2015 最后编辑:mccainzuser880386 更新时间:6/26/2015 访问量:22
指令和变量
Directives and variables
问:
我的指令中按以下方式控制和链接:
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。我该如何解决?
答: 暂无答案
评论
scope.$parent.$watch()