引导的卡口与angularjs数据触发原因重装 [英] Bootstrap's tabs with data-toggle cause reload in angularjs
问题描述
我刚刚迁移到AngularJS 1.2。我也意识到,这都配置了数据切换所有我的菜单/导航元素,例如:
I've just migrated to AngularJS 1.2. And I've realized that all my menu/navigation elements that were configured with data-toggle, for instance:
<li><a href="#additionalSelection" data-toggle="tab">Additional Selection</a></li>
不工作了。他们应该切换使用id =additionalSelection元素 - 这该是多么角和放大器;引导时,我采用了棱角分明的版本1.0.8的工作。
are not working any more. They should toggle element with id="additionalSelection" - and this is how Angular & Bootstrap worked when I was using version 1.0.8 of Angular.
但现在,当我点击锚元素,角拦截此点击,并试图去路线的 additionalSelection ,这会导致页面刷新...
But now, when I click anchor element, Angular intercepts this click and tries to go to route additionalSelection and it causes page refresh...
有没有办法解决?
推荐答案
解决方案是与数据目标替换的href 属性一样简单。这解决了这个问题:
The solution is as simple as replacing href attribute with data-target. That solves the issue:
<li><a data-target="#additionalSelection" data-toggle="tab">Additional Selection</a></li>
这篇关于引导的卡口与angularjs数据触发原因重装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!