Samuel Segal
Samuel Segal

Reputation: 423

Link-to class when not active

I have a link to helper that generate a <span>. The <span> should:

  1. have the class:"arrow open" when it is active.
  2. have the class:"arrow" when it is NOT active.

    {{#link-to 'status' tagName="span" activeClass="arrow open"}} {{/link-to}}

Question: The point 1 is working with the use of the activeClass. However, I don't how to assign a class when the link-to helper is not active as per the point 2.

tks

Upvotes: 0

Views: 38

Answers (1)

Buck Doyle
Buck Doyle

Reputation: 6397

Adapted from the guides:

{{#link-to 'status' tagName='span' class='arrow' activeClass='open'}} {{/link-to}}

The class property lets you set the class that will be present at all times.

Upvotes: 1

Related Questions