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
Cannot unregister component template #12859
Comments
@jakedetels how come you need to unregister a component and replace it at runtime? Can you just register both and use the component helper to switch at runtime? |
@jakedetels I think the suggestion by @GavinJoyce makes sense and may be an elegant way to swap the components with the component helper |
@mixonic do you think this is a bug? |
As we have no response from @jakedetels, I'm going to provisionally mark this wontfix and close it. |
I believe a valid use-case for this is to support template hot-swapping |
The
Ember.ApplicationInstance#unregister
method fails to fully unregister a component template. See twiddle here: https://ember-twiddle.com/47dd2375c095cd7e73e5I can successfully register a component template using:
However, when I try unregistering this template followed by registering a different compiled template in its place, the original template is the one that gets rendered.
In the twiddle demo, clicking "Register Template" will register the first compiled template. Then, clicking "Change Template" will first unregister the old template, followed by loading a new complied template. Yet when the component template is rendered, we still see the original compiled template. This demo utilizes the
{{component}}
helper to load the registered component template.cc @dgeb (possibly related to commit 53267df)
The text was updated successfully, but these errors were encountered: