angular.js - How does ng-click block child elements?
PHP中文网
PHP中文网 2017-05-15 17:00:52
0
1
799

There is the following DOM in angularjs

<p class="parent" ng-click="fun()">
    <p class="child"> </p>
</p>

I want ng-click to only fire when p.parent is clicked, and not when p.child is clicked.
I can also write complex methods, which can be achieved by judging the clicked element.
I hope it can be implemented in a simple way, preferably the function of angularjs itself. Please enlighten me.

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(1)
我想大声告诉你

$event.stopPropagation()

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template