mirror of
https://github.com/grafana/grafana.git
synced 2025-01-27 16:57:14 -06:00
24 lines
494 B
TypeScript
24 lines
494 B
TypeScript
|
import { auto } from 'angular';
|
||
|
|
||
|
let injector: auto.IInjectorService | undefined;
|
||
|
|
||
|
/**
|
||
|
* Future poc to lazy load angular app, not yet used
|
||
|
*/
|
||
|
export async function getAngularInjector(): Promise<auto.IInjectorService> {
|
||
|
if (injector) {
|
||
|
return injector;
|
||
|
}
|
||
|
|
||
|
const { AngularApp } = await import(/* webpackChunkName: "AngularApp" */ './index');
|
||
|
if (injector) {
|
||
|
return injector;
|
||
|
}
|
||
|
|
||
|
const app = new AngularApp();
|
||
|
app.init();
|
||
|
injector = app.bootstrap();
|
||
|
|
||
|
return injector;
|
||
|
}
|