Reputation: 14995
Twitter bootstrap accordion not working with Sammy.js
Is a similar question but was never answered.
I am creating an affixed Twitter Bootstrap side nav-list and using has based href's but when I click on them Sammy is trying to catch the routes. Since I am dynamically creating the Id's and href's I can prevent them from ever matching an existing route but it constantly hits the console with errors. I am sure in production they won't show up but is there anything that can be done to prevent this?
<ul class="nav nav-list affix">
<!-- ko foreach: sections -->
<li class="nav-header"><span data-bind="text: navDesc"></span></li>
<!-- ko foreach: paragraphs -->
<li><a data-bind="attr: { href: '#' + navProp() }"><span data-bind="text: navDesc"></span> <i class="icon-chevron-right"></i></a></li>
<!-- /ko -->
<!-- /ko -->
</ul>
I know this will be fixed in the next version of Durandal but just checking any other options.
Upvotes: 2
Views: 449
Reputation: 3723
Durandal 1.2 provides a guardRoute
method, which will allow you to intercept the call before it reaches sammy.
Check out How to handle / ignore a bad route with durandal? for more information.
Upvotes: 1