Fixes hot reloading via systemjs-hot-reloader#291
Merged
ocombe merged 1 commit intoocombe:masterfrom Sep 5, 2016
circlingthesun:fix-system-js-hot-reload
Merged
Fixes hot reloading via systemjs-hot-reloader#291ocombe merged 1 commit intoocombe:masterfrom circlingthesun:fix-system-js-hot-reload
ocombe merged 1 commit intoocombe:masterfrom
circlingthesun:fix-system-js-hot-reload
Conversation
Collaborator
|
+1 It looks good. How do you think @ocombe? Test/examples are running clearly. |
Owner
|
yes, it won't hurt anything anyway :) |
Owner
|
I just released 1.1.0 with this, I think I did it right, I haven't published a new version on this repo for ages, let me know if it works |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JSPM/SystemJS allows for hot module reloads via https://github.com/capaj/systemjs-hot-reloader. To get angular to see any module changes angular needs to be bootstrapped again. This can be achieved by save a copy of the original bootstrapped element before bootstrapping occurred. The current bootstrapped element then needs to be removed and replaced with another copy of the original. Once a fresh element is in place, angular.bootstrap can be called again and all changes should show.
When using ocLazyLoad to wire up modules loaded by JSPM this approach doesn't work. The reason is that ocLazyLoad keeps track of what angular modules have already been loaded and prevents them from being loaded again. This PR resets this state every time angular is bootstrapped so that modules will be wired up again after bootstrapping angular for a 2nd time.