I want to manually bootstrap an Angular 4 app (created with CLI).
In main.ts I am doing this:
const injector = ReflectiveInjector.resolveAndCrea
Thanks, Kuncevic. I have come up with this solution, which works fine:
function httpGetAsync(theUrl, callback) {
const xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function() {
if (xmlHttp.readyState === 4 && xmlHttp.status === 200) {
callback(xmlHttp.responseText);
}
}
xmlHttp.open('GET', theUrl, true); // true for asynchronous
xmlHttp.send(null);
}
httpGetAsync('assets/configs/configuration.json', (config: string) => {
ConfigurationService.configuration = JSON.parse(config);
platformBrowserDynamic().bootstrapModule(AppModule);
});