Skip to content

Instantly share code, notes, and snippets.

@kmaraz
Last active April 10, 2018 21:59
Show Gist options
  • Save kmaraz/196eeb130178d926b478c1b87d2036f0 to your computer and use it in GitHub Desktop.
Save kmaraz/196eeb130178d926b478c1b87d2036f0 to your computer and use it in GitHub Desktop.
// The original AngularJs application
const ngModule = angular.module('admin', [
// We are leaving all the old module untouched
'ng1.modules',
// We can downgrade Components, Directives, Services, etc.
// And use them in the AngularJs app
'ng2.modules'
]);
@NgModule({
imports: [ BrowserModule, UpgradeModule ]
})
class AppModule {
constructor(
private upgrade: UpgradeModule,
private injector: Injector
) { }
ngDoBootstrap() {
// Bootstrap main app
this.upgrade.bootstrap(document.body, ['admin']);
}
}
platformBrowserDynamic().bootstrapModule(AppModule);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment