-
Notifications
You must be signed in to change notification settings - Fork 3k
reload() doesn't resolve templates #751
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
Comments
I'm wondering... I don't think we reload templates for any states. Once its loaded its loaded and unexpected to change. So I don't think we'd reload templates for There is a bug where controllers don't get re-instantiated, and that is a problem we are fixing, but not sure about templates. Maybe this is more of a feature request. |
I see, but anyhow the templates are still re-downloaded, as I can see in network tab. Can you please check/confirm this? http://plnkr.co/edit/eHP5J8B97pxZBDWkZJuJ Here the state |
Ok so the problem is that the first template loads fine (delay and all) but the second template (when clicking 'de') loads in the network tab but never replaces the 'en' template on the page. Correct? |
Correct. Either no need to download, or the template should be replaced (but this might be a feature request as you mentioned). |
Actually I think this is a valid bug. The template should be replacing the previous one. Thank you for finding this. |
Is there an issue/commit for this? I just ran into this and don't know what the state of it is other than your comment. |
yep. #582. |
Closing because this is really really old, the plunker link doesn't work, and I think this is fixed in 1.0 codebase. Please reopen if the issue is still valid. |
I've have a scenario to reload state if the user changes language. The language is changed on server side, so the templates are translated by the server (using a lang parameter or a session value for the language).
I've created a languageTemplateProvider function (used in
state.templateProvider
) like this:On language change I clear the
$templateCache
so the template is re-downloaded from the server correctly.But here comes the possible BUG: the state reloads/resolves before the
$http
finishes with the old template. Why?On normal state change, the change happens only after the templates are correctly downloaded, so it seems correct (simulated with
$timeout
).Sorry that I cannot provide a plunkr, but my app is already very complex to extract the needed components...
The text was updated successfully, but these errors were encountered: