I have an Angular 4 app which is using SystemJS
. I want to move to using Angular CLI
. The problem is, I bootstrap the application in the index.html
using a script tag as follows.
<script>
var sf = $.ServicesFramework([ModuleContext:ModuleId]);
System.import('app/main.js')
.then(module => module.main(sf.getModuleId(), sf.getTabId(), sf.getAntiForgeryValue())
.catch(function (err) { console.error(err); });
</script>
Here is the relevant code from my main.ts
export function main(dnnModuleId: number, dnnTabId: number, dnnAntiForgeryToken: string) {
let appConfig: IAppConfig = {
DNN_MODULE_ID: dnnModuleId
...
}
platformBrowserDynamic([
{provide: APP_CONFIG_TOKEN, useValue: appconfig
...
]).bootstrapModule(AppModule);
After an extensive search, I i was only able to find an old question related to Webpack 1 and not related to Angular CLI
.
In short is it possible to do this with Angular CLI?
If so, any guidance in where to begin looking would be much appreciated.