I'm trying to pass parameters to my application. I found this solution which seems to have worked for people. The problem is I am using angular-cli to set up/build and ever since ~beta.14 it uses webpack instead of SystemJS.
My main.ts looks like this:
import './polyfills.ts';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { environment } from './environments/environment';
import { AppModule } from './app/';
if (environment.production) {
enableProdMode();
}
export function main(appLocalized: any) {
platformBrowserDynamic([{provide: 'AppLocalized', useValue: appLocalized }])
.bootstrapModule(AppModule);
}
but I'm not sure how to access this function from index.html.
My dist/index.html looks like this:
<body>
<app-root>Loading...</app-root>
<script type="text/javascript" src="inline.js"></script><script type="text/javascript" src="styles.bundle.js"></script><script type="text/javascript" src="main.bundle.js"></script></body>
My question is, how do I call the function to pass my data in, like is done in the other post:
<script>
System.import('app').then(module => module.main('This is RIGHT'),
console.error.bind(console)
);
</script>