mirror of
https://github.com/grafana/grafana.git
synced 2024-11-30 12:44:10 -06:00
23 lines
566 B
TypeScript
23 lines
566 B
TypeScript
|
import { config, setAngularLoader } from '@grafana/runtime';
|
||
|
|
||
|
export async function loadAndInitAngularIfEnabled() {
|
||
|
if (config.angularSupportEnabled) {
|
||
|
const { AngularApp } = await import(/* webpackChunkName: "AngularApp" */ './index');
|
||
|
const app = new AngularApp();
|
||
|
app.init();
|
||
|
app.bootstrap();
|
||
|
} else {
|
||
|
setAngularLoader({
|
||
|
load: (elem, scopeProps, template) => {
|
||
|
return {
|
||
|
destroy: () => {},
|
||
|
digest: () => {},
|
||
|
getScope: () => {
|
||
|
return {};
|
||
|
},
|
||
|
};
|
||
|
},
|
||
|
});
|
||
|
}
|
||
|
}
|