Created
January 14, 2017 12:14
-
-
Save jordic/52085c9cecebe487a8f743268b8cb418 to your computer and use it in GitHub Desktop.
webpack angular system.import
This file contains 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
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