diff --git a/front/core/components/searchbar/searchbar.js b/front/core/components/searchbar/searchbar.js
index 6555b707e..f5ead38a4 100644
--- a/front/core/components/searchbar/searchbar.js
+++ b/front/core/components/searchbar/searchbar.js
@@ -61,7 +61,8 @@ export default class Controller extends Component {
if (event.defaultPrevented) return;
event.preventDefault();
- this.$panel = this.$compile(`<${this.panel}/>`)(this.$.$new());
+ this.$panelScope = this.$.$new();
+ this.$panel = this.$compile(`<${this.panel}/>`)(this.$panelScope);
let panel = this.$panel.isolateScope().$ctrl;
panel.filter = this._filter;
panel.onSubmit = filter => this.onPanelSubmit(filter);
@@ -72,7 +73,7 @@ export default class Controller extends Component {
}
onPopoverClose() {
- this.$panel.scope().$destroy();
+ this.$panelScope.$destroy();
this.$panel.remove();
this.$panel = null;
}
diff --git a/modules/order/front/filter/index.js b/modules/order/front/filter/index.js
index c2bfb8e4b..8a80a80e2 100644
--- a/modules/order/front/filter/index.js
+++ b/modules/order/front/filter/index.js
@@ -136,7 +136,8 @@ class Controller {
if (event.defaultPrevented) return;
event.preventDefault();
- this.$panel = this.$compile(``)(this.$scope.$new());
+ this.$panelScope = this.$scope.$new();
+ this.$panel = this.$compile(``)(this.$panelScope);
const panel = this.$panel.isolateScope().$ctrl;
panel.filter = this.filter;
panel.onSubmit = filter => this.onPanelSubmit(filter);
@@ -153,7 +154,7 @@ class Controller {
}
onPopoverClose() {
- this.$panel.scope().$destroy();
+ this.$panelScope.$destroy();
this.$panel.remove();
this.$panel = null;
}