I've got an unordered list using Bootstrap and Ember.js. Each list item is a link to display a new post, and whenever you click on the link, Ember adds the class active
by default. I'm using Bootstrap nav-pills
that turn blue when the class is active
. However, Ember makes the link active
whereas I'd like it to make the whole <li>
active.
Here's my template:
<ul class="nav nav-pills nav-stacked">
{{#each post in controller}}
<li class="list-group-item">
{{#link-to 'post' post}}
{{post.title}}
{{/link-to}}
</li>
{{/each}}
</ul>
When you click on a link, the <li>
looks like this:
<li class="list-group-item">
<a id="ember360" class="ember-view active" href="#/posts/1">
A great post
</a>
</li>
I know that it would be fairly trivial to add this functionality with jQuery, but is there a way to make the <li>
active rather than the <a>
with Ember or Handlebars directly? I tried putting the {{link-to}}
around the <li>
and that didn't do the trick.