Use the stopPropagation
method on the angular $event
object:
<div ng-click="parent()">
<div ng-click="d(); $event.stopPropagation();"></div>
</div>
Or pass the $event
object as an argument of the ng-click
method, and call stopPropagation
in the method:
<div ng-click="parent()">
<div ng-click="d($event)"></div>
</div>
In d
:
$scope.d = function (event) {
// ...
event.stopPropagation();
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…