The problem is when I click on button with such href attribute, it causes full page reload, which means, everything in current page is lost.
Is there a way to prevent this?
some extra info:
when i hover on the button, the url is weird. for example, my current page's url is
localhost:8080/#/account
the button's href is
href="#myModal"
I expect to see url
localhost:8080/#/account#myModal
However, what I see is
localhost:8080/#myModal
I am not sure if this is related to my problem.
Thanks in advance!
EDIT 1
I have seen the other post that Stewie talked about. It explains html5mode and hashbang in angularjs, but it doesn't really solve my problem.
I tried putting html5mode, and it still reloads the page when i click on the button
解决方案
The hashbang in Angular is used for routing. Look at the tutorial for a deeper insight into how it works here.
Regular Boostrap wasn't built with Angular in mind, so there are few things that aren't in line with Angular. So the team decided to port Boostrap into Angular directives, giving you the ability to fully use Angular's ng- features (which you wouldn't be able to do easily with just regular Boostrap).
Due to the way routing works, I don't think you would be able to do what you want, and you shouldn't need to. Since you're using the <a> as a button, make it a regular button and add an ng-click: