href causes unintended page reload with Angularjs and Twitter Bootstrap

后端 未结 7 1998
被撕碎了的回忆
被撕碎了的回忆 2020-12-14 16:02

I am working on a project that uses Angularjs and Twitter Bootstrap.

Bootstrap uses # to toggle components such as popover, modal etc. for example:

&         


        
相关标签:
7条回答
  • 2020-12-14 16:35

    This is because of HTML link rewriting of Angular, explained here.

    To prevent rewriting of location, add target=_self to those bootstrap links.

    So instead of <a href="#myModal"> you need <a href="#myModal" target="_self">

    0 讨论(0)
提交回复
热议问题