Yield computed properties in link-to component#15835
Closed
sukima wants to merge 1 commit intoemberjs:masterfrom
Closed
Yield computed properties in link-to component#15835sukima wants to merge 1 commit intoemberjs:masterfrom
sukima wants to merge 1 commit intoemberjs:masterfrom
Conversation
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}}
```
Contributor
|
@sukima This is cool! I wonder if this could use a test in |
Contributor
|
This introduces new public API, so it necessitates an RFC. |
Contributor
Author
Member
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This would allow greater flexibility and support for some CSS frameworks and situations where the link-to needs more than one element. For example:
Or even more complex ideas: