1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 23:51:09 +03:00

Merge pull request #2355 from Haokun-Chen/2197

deregister the transition hook when destroy smart-search controller
This commit is contained in:
Haokun Chen 2018-07-02 10:18:25 -04:00 committed by GitHub
commit d17f3d7d2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -152,8 +152,11 @@ function SmartSearchController (
$scope.$emit(optionsKey, data.options);
}
});
$scope.$on('$destroy', transitionSuccessListener);
$scope.$on('$destroy', () => {
if (transitionSuccessListener) {
transitionSuccessListener();
}
});
$scope.$watch('disableSearch', disableSearch => {
if (disableSearch) {
$scope.searchPlaceholder = i18n._('Cannot search running job');