Exposing digest from angular component

This commit is contained in:
Peter Holmberg
2018-11-05 13:39:57 +01:00
parent e37fa486ed
commit 52232f98b9
2 changed files with 6 additions and 0 deletions

View File

@@ -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();
},
};
}
}

View File

@@ -40,6 +40,8 @@ export class PluginSettings extends PureComponent<Props> {
componentDidUpdate(prevProps) {
if (this.props.dataSource !== prevProps.dataSource) {
this.scopeProps.ctrl.current = _.cloneDeep(this.props.dataSource);
this.component.digest();
}
}