mirror of
https://github.com/grafana/grafana.git
synced 2024-11-27 19:30:36 -06:00
2b9e46d1f8
* Angular: Initial setting that disables angular, load angular support in separate chunk * Load angular panels on demand * Load alerting in separate chunk only when angularSupportEnabled * progress, do not export core_module if angular disabled * Progress * Update public/app/features/plugins/built_in_plugins.ts Co-authored-by: Ryan McKinley <ryantxu@gmail.com> * Removing remaining usage of angular from outside angular app (not counting plugins) * Update config and docs * Fix sample.ini * Update public/app/features/alerting/AlertTab.tsx Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com> * Fixing prettier issue Co-authored-by: Ryan McKinley <ryantxu@gmail.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
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 {};
|
|
},
|
|
};
|
|
},
|
|
});
|
|
}
|
|
}
|