Closed circlingthesun closed 8 years ago
+1 It looks good. How do you think @ocombe? Test/examples are running clearly.
yes, it won't hurt anything anyway :)
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
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.