angularjs - Prevent triggering Angular Material md-swipe-left/md-swipe-right directive's function on parent element -
i have parent element fills 100% of page height , several child elements inside it. swipe-right on parent toggles side menu, want prevent function , trigger childaction() when swipe-right on it's child.
<div id="parent" md-swipe-right="togglesidemenu()"> <div id="child" md-swipe-right="childaction()"> .... </div> </div>
the md-swipe-right other event directives provides $event local.1
in html include $event argument function.
<div id="parent" md-swipe-right="togglesidemenu()"> <div id="child" md-swipe-right="childaction($event)"> .... </div> </div> in controller invoke stoppropagation() function.
$scope.childaction = function (event) { event.stoppropagation(); }); for more information on $event see, angularjs developer guide -- expressions -- $event
Comments
Post a Comment