2

i would like to use the bootstrap accordion in my angular-application. I'm using the angular ui-router for Routing through the sites.

Now I'm facing a problem that the accordion needs an

<a href="#CollapseOne"> Tag.

The problem is that the ui-router "thinks" it has to do something and tries to navigate to "#CollapseOne".

How can I stop ui-routing on some ?

1
  • can you please post some more code or provide a plunker? Commented Jul 9, 2016 at 11:19

2 Answers 2

2

Use Angular UI Bootstrap. You can find Accordion here: https://angular-ui.github.io/bootstrap/

Sign up to request clarification or add additional context in comments.

Comments

0

You can use $urlRouterProvider.when() with a do nothing handler function to stop routing for some URLs

$urlRouterProvider.when("/CollapseOne", function() {
  //do nothing
});

Alternatively simply replace href with data-target which will fix your problem

<a data-target="#CollapseOne" data-toggle="collapse">Tag</a>.

1 Comment

thank you. data-target is exactly what I was looking for!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.