3
有没有办法阻止广播从父母传播到子控制器?在angularjs中停止从父到子控制器的广播传播?
家长:
$scope.$on('event', function() {
//stop propagation
})
儿童:
$scope.$on('event', function() {
//only fired by this controller scope
})
有没有办法阻止广播从父母传播到子控制器?在angularjs中停止从父到子控制器的广播传播?
家长:
$scope.$on('event', function() {
//stop propagation
})
儿童:
$scope.$on('event', function() {
//only fired by this controller scope
})
哦,这很容易。
if (ev.targetScope.$id != ev.currentScope.$id) {
return
}