Assigning 'active' class to selected list item in EmberJS

后端 未结 12 2092
星月不相逢
星月不相逢 2020-12-08 00:34

I have a list and I\'d like to set one item as class=\"active\" automatically. Given the following bootstrap code:

12条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-08 01:05

    I found a pretty simple Solution using linked items in a list group(http://getbootstrap.com/components/#list-group-linked).

    {{#each thing in list}} {{#link-to "details" thing.id tagName="a" href="view.href" class="list-group-item" {{thing.name}} {{/link-to}} {{/each}}

    Works with Bootstrap v3.1.1 and Ember v1.7.0

提交回复
热议问题