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 with component #28

Open
patricklx opened this issue Nov 29, 2020 · 1 comment
Open

Yield with component #28

patricklx opened this issue Nov 29, 2020 · 1 comment

Comments

@patricklx
Copy link

patricklx commented Nov 29, 2020

Can this be extended to yield with a component?
Could look like this

{{yield to="header" with=(component "header")}}

Then

<:header @title=abc \>

I know this wasn't part of the proposal, but i think its a good Idea.

Another idea is also to put the yield inside a html tag like a modifier and yield that whole block as inline component. That would require again another yield somewhere and also need to handle the this context correctly.
Could already be done with preprocessing and creating template only components ( and convert this to @this ) on thr fly

@Techn1x
Copy link
Contributor

Techn1x commented Jul 14, 2021

I believe you can achieve pretty much what you're after with syntax like this;

  {{yield (component "header") to="header"}}
<:header as |HeaderComponent|>
  <HeaderComponent @title="abc" />
</:header>

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