-
Notifications
You must be signed in to change notification settings - Fork 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
{{#with <value that's false> as |bar|}} block isn't rendered #1224
Comments
It's explicitly checking for empty arrays, null, undefined, false (but not 0), and rendering any provided From your example:
It will print Whether that's a good idea is up for grabs, but at the very least this appears to be working as intended. |
It does seem to be operating as coded, but this behaviour does not appear to be covered in the documentation, and seems unexpected to my read. The documentation says:
That is, the use case is aliasing as a way to avoid repeating the parent name. My expectation was that the contents would be rendered in all cases. From the code I can see the For my 2c, I suggest removing the else case and having the contents rendered in all cases. |
It has been introduced here. There was no discussion, no complaint. |
Thanks @nknapp for the link to the pull request, which does explain things. And yes, I have already written my own handler :) My interest is confirming intended usage and documenting it - I'd not seen the pull request you reference, which makes sense, although the documentation does not reflect this usage pattern. Perhaps the suggestion should be for a For example, I use the following to alias parameters to an inline partial:
Thoughts/suggestions? |
Closing due to inactivity. This is also now covered by examples in the documentation. |
Maybe this is expected. The docs didn't seem to answer this particular scenario.
I put together a fiddle here:
https://jsfiddle.net/oo3qq3nx/1/
Specifically, I was expecting
to render
or maybe
The fact that it wasn't rendered at all was unexpected to me. I'm not sure if this is a bug or simply unclear in the docs.
The text was updated successfully, but these errors were encountered: