Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap's tabs with data-toggle cause reload in angularjs

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> 

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.

But now, when I click anchor element, Angular intercepts this click and tries to go to route additionalSelection and it causes page refresh...

Is there a way to fix it?

like image 981
dragonfly Avatar asked Nov 12 '13 13:11

dragonfly


Video Answer


1 Answers

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> 
like image 161
dragonfly Avatar answered Sep 23 '22 12:09

dragonfly