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

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');