Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yield computed properties in link-to component #15835

Closed
wants to merge 1 commit into from

Conversation

sukima
Copy link
Contributor

@sukima sukima commented Nov 8, 2017

This would allow greater flexibility and support for some CSS frameworks and situations where the link-to needs more than one element. For example:

{{#link-to "my-route" tagName="li" as |link|}}
  <a href={{link.href}} class="{{link.active}}">Link Title</a>
{{/link-to}}

Or even more complex ideas:

{{#link-to "my-route" tagName="li" as |link|}}
  {{#if link.active}}
    <span class="red">Current Route</span>
  {{else}}
    <a href={{link.href}}>Link Title</a>
  {{/if}}
{{/link-to}}

This would allow greater flexibility and support for some CSS frameworks and situations where the link-to needs more than one element. For example:

```hbs
{{#link-to "my-route" tagName="li" as |link|}}
  <a href={{link.href}} class="{{link.active}}">Link Title</a>
{{/link-to}}
```

Or even more complex ideas:

```hbs
{{#link-to "my-route" tagName="li" as |link|}}
  {{#if link.active}}
    <span class="red">Current Route</span>
  {{else}}
    <a href={{link.href}}>Link Title</a>
  {{/if}}
{{/link-to}}
```
@snewcomer
Copy link
Contributor

@sukima This is cool! I wonder if this could use a test in link-to-test.js? What do you think?

@locks
Copy link
Contributor

locks commented Nov 27, 2017

This introduces new public API, so it necessitates an RFC.

@sukima
Copy link
Contributor Author

sukima commented Dec 10, 2017

@mmun
Copy link
Member

mmun commented Feb 23, 2018

I'm closing this issue in light of emberjs/rfcs#275 (comment).

I still strongly encourage people to continue exploring this space in addons and in discussion issues on the RFC repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants