Skip to content

Instantly share code, notes, and snippets.

@jordic
Created January 14, 2017 12:14
Show Gist options
  • Save jordic/52085c9cecebe487a8f743268b8cb418 to your computer and use it in GitHub Desktop.
Save jordic/52085c9cecebe487a8f743268b8cb418 to your computer and use it in GitHub Desktop.
webpack angular system.import
declare var System: any;
declare var hola: any;
declare var window:any;
export function load() {
System.import('app/test.js').then((m) => {
// hola();
console.log('loaded', m);
m.hola();
}).catch((e) => {
console.log('error loading', e);
})
}
window.loadChild = load;
window.System = System;
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
// FormsModule,
// HttpModule,
TracksStoreModule,
StoreDevtoolsModule.instrumentOnlyWithExtension(),
PagesModule,
RouterModule,
SWModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment