-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[Bug] Named block in {{if}} not allowed? #19503
Comments
Indeed, this is not possible at the moment. Godfrey's emberconf talk covers some scenarios which you can / can't do, including the scenario you are describing. Hope it helps! |
There's also some discussion going on here. |
Ah, thank you very much, that's insightful! Of course a bit of a bummer, would be great to have that. I have some use cases in mind where I would kind of need to "optionally" pass through some named blocks, which are not really possible to do (nicely) without some conditionals. |
I run into this issue often. I've had to work around it when doing multiple levels of components where I want to pass a block down to a child component, I have to do stuff like |
🐞 Describe the Bug
I am not 100% sure if this is a bug, or if I misunderstand something. Is it not possible to provide an optional named block?
With a slightly simplified component like this:
I would expect to be able to do e.g. this:
However, this gives me the build error:
Is this correct - should this not be supported?
If not, what would be the recommended way to realize something like this? Do I really need to repeat the whole component invocation with and without blocks - providing for all possible combinations of attributes and blocks?
🤔 Expected Behavior
I would expect helpers like each or if to work in a way as described in my example.
🌍 Environment
The text was updated successfully, but these errors were encountered: