-1

How do we tell Angular not to try to go to a route if we simply have an anchor such as:

<a href="#home" data-toggle="tab">Home</a>

When we click on "Home" we're just simply hiding/showing div sections on the current view with CSS but as stated, Angular thinks we're going to a specified route which we may have set up in app.js or something.

Any ideas?

Thanks much,

David

David Whitten
  • 199
  • 1
  • 8

2 Answers2

0

Use data-target instead of href to specify the target id

<a data-target="#home" data-toggle="tab"> Home </a>
Vishnu
  • 11,614
  • 6
  • 51
  • 90
0

This is due to angular link rewriting explained here: https://docs.angularjs.org/guide/$location

Add target="_self" to the link to prevent it.

You should also consider Angular Directives for Bootstrap. https://angular-ui.github.io/bootstrap/

Strelok
  • 50,229
  • 9
  • 102
  • 115