-
Notifications
You must be signed in to change notification settings - Fork 25
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
setting name=null breaks {{from-elsewhere}} #4
Comments
You can label this as a low-priority issue... my current solution is to just wrap the helper in an |
We should fix this so it doesn't break on name=null. But your example seems like a weird use case for this add-on. I am curious what you are trying to do and why the regular |
Elsewhere allows me to have much more varied components render in the same place... where {{component}} helper narrows you in to a more uniform component invocation. for instance if two components have completely different attrs and/or actions... the Elsewhere, so far has been the cleanest solution for me and the specific UI that I am building... I have an uncommon use case perhaps.. but a valid one as far as i can see. At any rate, if the {{from-elsewhere would gracefully just render nothing or even just an empty |
But you still must have all those other invocations in your template somewhere anyway. For example: {{#if activeComponent}}
{{from-elsewhere name=activeComponent}}
{{/if}}
{{to-elsewhere named="general-info" send=(component "general-info" info=info action=(action 'infoAction'))}}
{{to-elsewhere named="product-info" send=(component "product-info" product=product)}} Is equivalent to this, which is both simpler and faster: {{#if (eq activeComponent "general-info")}}
{{general-info info=info action=(action 'infoAction') }}
{{else if (eq activeComponent "product-info") }}
{{product-info product=product}}
{{/if}} |
ah but it is more complex than that. imagine a template divided into quadrants. each quadrant has tabbed panels. then imagine a large list of component invocations. those components can render into any one of those quadrants in any configuration, via the tabbed navigation, dragging and dropping tabs into other quadrants also "moves" said component into the new quadrant. i guess the main thing is "any component, anywhere" as easily as possible without duplicating invocations. fwiw.. i already have this UI finished.. using the {{component}} helper successfully... but i ran into some walls when adding more and more features into each component. oh and also ( :p :p ) I've already converted the whole thing to |
👍 |
In this twiddle, I am binding a value to
name
in a{{from-elsewhere
It appears that, if the binding becomes
null
it will break the helper, even if you setname
back to a valid string.the only way the helper continues to work is if you are consuming the name binding somewhere else in the template.
this is confusing because the binding i am using is not a computed property.. so im not quite sure why i need to consume it for the helper to work?
https://ember-twiddle.com/dd9c2e80c52c98eb3860b132abc74c17?openFiles=templates.application.hbs%2C
you can reproduce the behavior in this twiddle if you remove the
{{activeComponent}}
at the top ofapplication.hbs
The text was updated successfully, but these errors were encountered: