Last active
November 2, 2015 05:42
-
-
Save shangoyanyi/91507486200e10180bf1 to your computer and use it in GitHub Desktop.
Angular - solve the conflict between ng-route and bootstrap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* bootstrap can use <a href='#' class='some-class' >link</a> as a button, | |
* and angular catches <a>link</a> click event to do the route. | |
* this is how to prevent the routing being triggered when user click the button. | |
*/ | |
$scope.doThings = function($event){ | |
$event.stopPropagation(); //prevent event propagation | |
//some other things to do | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment