mirror of
https://github.com/grafana/grafana.git
synced 2024-11-28 03:34:15 -06:00
Annotations: Ensure legacy annotation editors are cleaned up properly when switching datasource (#41115)
* Annotations: Ensure Angular-based annotation editors are cleaned up properly * Annotations: Remove ng-if instead of wrapping in div
This commit is contained in:
parent
3c5003373c
commit
e0b2e0b152
@ -52,7 +52,10 @@ export class AngularEditorLoader extends React.PureComponent<Props> {
|
||||
}
|
||||
|
||||
const loader = getAngularLoader();
|
||||
const template = `<plugin-component ng-if="!ctrl.currentDatasource.annotations" type="annotations-query-ctrl"> </plugin-component>`;
|
||||
// NOTE: BE CAREFUL HERE
|
||||
// If this template contains an ng-if, then it won't be removed correctly by AngularLoader.
|
||||
// The compiledElem will only contain the single comment node (e.g. <!-- ngIf !ctrl.currentDatasource.annotations -->)
|
||||
const template = `<plugin-component type="annotations-query-ctrl"> </plugin-component>`;
|
||||
const scopeProps = {
|
||||
ctrl: {
|
||||
currentDatasource: this.props.datasource,
|
||||
|
Loading…
Reference in New Issue
Block a user