corregido error al destruir popover en searchBar

This commit is contained in:
Dani Herrero 2017-07-13 13:32:23 +02:00
parent 9fa608b11f
commit 1fc059273f
1 changed files with 5 additions and 2 deletions

View File

@ -29,8 +29,11 @@ export default class Controller {
if (this.onSearch) if (this.onSearch)
this.onSearch(); this.onSearch();
angular.element(this.child).scope().$destroy(); if (angular.element(this.child)) {
angular.element(this.child).remove(); if (angular.element(this.child).scope())
angular.element(this.child).scope().$destroy();
angular.element(this.child).remove();
}
delete this.child; delete this.child;
} }
$onDestroy() { $onDestroy() {