mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Angular: only bootstrap the root application element (#40822)
* Angular: Do not bootstrap Angular against entire document * Do not retrieve injector by using angular instance directly.
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import angular from 'angular';
|
||||
import $ from 'jquery';
|
||||
import { partition, each } from 'lodash';
|
||||
//@ts-ignore
|
||||
import Drop from 'tether-drop';
|
||||
import { CreatePlotOverlay } from '@grafana/data';
|
||||
import { getLegacyAngularInjector } from '@grafana/runtime';
|
||||
|
||||
/** @ngInject */
|
||||
const createAnnotationToolip: CreatePlotOverlay = (element, event, plot) => {
|
||||
const injector = angular.element(document).injector();
|
||||
const injector = getLegacyAngularInjector();
|
||||
const content = document.createElement('div');
|
||||
content.innerHTML = '<annotation-tooltip event="event" on-edit="onEdit()"></annotation-tooltip>';
|
||||
|
||||
@@ -68,7 +68,7 @@ const createEditPopover: CreatePlotOverlay = (element, event, plot) => {
|
||||
|
||||
// wait for element to be attached and positioned
|
||||
setTimeout(() => {
|
||||
const injector = angular.element(document).injector();
|
||||
const injector = getLegacyAngularInjector();
|
||||
const content = document.createElement('div');
|
||||
content.innerHTML = '<event-editor panel-ctrl="panelCtrl" event="event" close="close()"></event-editor>';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user