Hybrid lazy-loading Angular1 + Angular2 using UI-Router, Webpack2 and Babel.
- During this time we include require in which is the Angular2 master module that is Angular uses under the hood to orchestrate the upgrade process.
- Since we are upgrading ng1 components and services, we need a common module for ng1 that is registered at runtime without lazy-loading so that the adapter knows how to resolve those ng1 dependencies.
- Its important to note due to the scoping of ng2, we also have to include in all the state modules such as .
- Also, all of that logic should live next to where its defined so having the comprehensive states in the module definition is ideal.
- The first function ( ) is a Angular1 helper that calls function that when invoked will pass the resolve promise from the import to ocLazyLoad to recursively resolve and register all our ng1 modules.