weChatDirective.directive('tab1', function() {
return {
restrict: 'E',
replace : true,
templateUrl: '..',
controller : function($scope){
$scope.viewdata = {
"type":"view",
"name":"外部连接",
"url":"http://www.soso.com/"
};
this.viewdata = $scope.viewdata;
},
link: ...
};
});
weChatDirective.directive('tabReply', function() {
return {
restrict: 'E',
require : '^tab1',
controller : ["$scope",function($scope){
$scope.hasChanged = function(){};
}],
replace: true,
templateUrl: './dist/weChat/templates/weChatMenuReply.html',
link: function(scope, element, attr,reController) {
console.log(reController);
}
}
})
tab1指令中的viewdata变化的时候 想要执行tabReply指令里的hasChanged函数 如何实现??大神赐教。还是我陷入思维误区了。。。。
在tabReply指令的controller中加上一行