emblem.js: Link-to helper doesn't like class conditions
I am trying to use class conditions with a link-to helper, but fails on compilation.
link-to view.linkName lnid urlSlug itemprop="url" class={view.isSelected:selected view.icon}
doesnt work.
link-to view.linkName lnid urlSlug itemprop="url" class=view.isSelected:selected
doesnt work either.
a href="#" class={view.isSelected:selected view.icon}
works fine.
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 16 (1 by maintainers)
Inside mustache you need to use Ember’s inline if:
Some things to keep in mind:
{ }
are for wrapping things in mustache. In alink-to
you are already in a mustache context, so these won’t work.class
orclassNames
is very different thanclassNameBindings
. The inline approach should still work for the latter.I’m pretty sure the old colon syntax of
isActive:active:inactive
is not supported anymore by Ember.