AngularJS conflicting with Bootstrap tabs

I use Bootstrap 3 JavaScript bookmarks as documented, for example:

<!-- Nav tabs --> <ul class="nav nav-tabs" role="tablist"> <li class="active"><a href="#home" role="tab" data-toggle="tab">Home</a></li> <li><a href="#profile" role="tab" data-toggle="tab">Profile</a></li> <li><a href="#messages" role="tab" data-toggle="tab">Messages</a></li> <li><a href="#settings" role="tab" data-toggle="tab">Settings</a></li> </ul> <!-- Tab panes --> <div class="tab-content"> <div class="tab-pane active" id="home">...</div> <div class="tab-pane" id="profile">...</div> <div class="tab-pane" id="messages">...</div> <div class="tab-pane" id="settings">...</div> </div> 

But with Angular, for example, it changes the URL to / # / profile.

How can I prevent this?

+6
source share
2 answers

At some point, if the link has a set of _target attributes, angular will not intercept these clicks. Perhaps this will work in this case?

+7
source

Just put data-target instead of the href attribute and it will work without changing the urls.

+19
source

Source: https://habr.com/ru/post/975947/


All Articles