AngularJS stop event propagation
In AngularJS context:
If you have the following in your page,
<a ng-click="nextPage($event)">Button</a>
then in your controller, you should say
$scope.nextPage = function($event){
$event.stopPropagation();
}
I was trying this with jquery like this:
$('selector').on('click', 'target-selector', function(e){
e.stopPropagation();
});
This just doesn't work because the event has already fired in by the time we check for event propagation.
Written by Aditya Saxena
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Javascript
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#