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 isActive in block template #14

Open
lougreenwood opened this issue Aug 18, 2018 · 2 comments
Open

Yield isActive in block template #14

lougreenwood opened this issue Aug 18, 2018 · 2 comments

Comments

@lougreenwood
Copy link

It would be great if it were possible to access the isActive property in the block template to allow for content variations.

emberjs/ember.js#15835
https://discuss.emberjs.com/t/best-way-to-yield-the-active-state-of-a-linkto/14968/2

@asross
Copy link
Owner

asross commented Aug 18, 2018

Thanks for creating this issue, the feature idea sounds good to me! I’m on a vacation right now but I’ll try to take a pass at this soon. PRs are also welcome :)

As a workaround for anyone reading this before we implement this feature, you can always include both conditionals inside different elements, but use CSS to only show one (based on the active class). Another option is just to have a higher level conditional. But it definitely makes sense to be able to have conditionals inside the block :)

@lougreenwood
Copy link
Author

I'm happy to attempt a PR, any pointer on how you might approach this? I was thinking it might be as simple as adding a template for the component and yielding isActive from there?

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

No branches or pull requests

2 participants