From 52232f98b996e59357b68c54d425f8f3f3d0f655 Mon Sep 17 00:00:00 2001 From: Peter Holmberg Date: Mon, 5 Nov 2018 13:39:57 +0100 Subject: [PATCH] Exposing digest from angular component --- public/app/core/services/AngularLoader.ts | 4 ++++ public/app/features/datasources/settings/PluginSettings.tsx | 2 ++ 2 files changed, 6 insertions(+) diff --git a/public/app/core/services/AngularLoader.ts b/public/app/core/services/AngularLoader.ts index e3a7dec4351..3f5c535297f 100644 --- a/public/app/core/services/AngularLoader.ts +++ b/public/app/core/services/AngularLoader.ts @@ -4,6 +4,7 @@ import _ from 'lodash'; export interface AngularComponent { destroy(); + digest(); } export class AngularLoader { @@ -24,6 +25,9 @@ export class AngularLoader { scope.$destroy(); compiledElem.remove(); }, + digest: () => { + scope.$digest(); + }, }; } } diff --git a/public/app/features/datasources/settings/PluginSettings.tsx b/public/app/features/datasources/settings/PluginSettings.tsx index ec6981927fa..e0b742985cc 100644 --- a/public/app/features/datasources/settings/PluginSettings.tsx +++ b/public/app/features/datasources/settings/PluginSettings.tsx @@ -40,6 +40,8 @@ export class PluginSettings extends PureComponent { componentDidUpdate(prevProps) { if (this.props.dataSource !== prevProps.dataSource) { this.scopeProps.ctrl.current = _.cloneDeep(this.props.dataSource); + + this.component.digest(); } }