Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The <code>link-to</code> by default creates an <code>&lt;a&gt;</code> element, and set the class <code>active</code> when the current route matches the target route of the link. The bootstrap expects the <code>active</code> class to be present in the <code>li</code> tag. And an <code>&lt;a&gt;</code> element inside.</p> <p>So you need to use <code>{{#link-to ... tagName="li"}}</code> like your second aproach and inside an <code>&lt;a&gt;</code> element. Otherwise the style isn't applied.</p> <p>Like this:</p> <pre><code>&lt;ul class="nav nav-pills nav-stacked" style="max-width: 300px;"&gt; {{#link-to "index" tagName="li"}} &lt;a href="#"&gt;&lt;span class="glyphicon glyphicon-home"&gt;&lt;/span&gt; &amp;nbsp &amp;nbsp Home&lt;/a&gt; {{/link-to}} {{#link-to "settings" tagName="li"}} &lt;a href="#"&gt;&lt;span class="glyphicon glyphicon-wrench"&gt;&lt;/span&gt; &amp;nbsp &amp;nbsp Settings&lt;/a&gt; {{/link-to}} {{#link-to "logout" tagName="li"}} &lt;a href="#"&gt;&lt;span class="glyphicon glyphicon-arrow-right"&gt;&lt;/span&gt; Logout&lt;/a&gt; {{/link-to}} &lt;/ul&gt; </code></pre> <p>See this in action <a href="http://jsfiddle.net/marciojunior/E63Hy/" rel="nofollow">http://jsfiddle.net/marciojunior/E63Hy/</a></p> <p>The only downside of this, is your href won't match the target route, it's fixed with <code>href="#"</code>. Because when the <code>link-to</code> tagName is different of <code>a</code>, no href is generated. So even a <code>&lt;a href="{{href}}"&gt;</code> doesn't work. Of course, this is just visual, clicking in the link-to will transition to the target route, and update the url accordingly.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload