diff --git a/src/ng1/directives/stateDirectives.ts b/src/ng1/directives/stateDirectives.ts index c2f39abb..e8208bc2 100644 --- a/src/ng1/directives/stateDirectives.ts +++ b/src/ng1/directives/stateDirectives.ts @@ -181,9 +181,9 @@ function $StateRefDirective($state: StateService, $timeout: ITimeoutService) { if (!type.clickable) return; hookFn = clickHook(element, $state, $timeout, type, function() { return def; }); - element.on("click", hookFn); + element[element.on ? 'on' : 'bind']("click", hookFn); scope.$on('$destroy', function() { - element.off("click", hookFn); + element[element.off ? 'off' : 'unbind']("click", hookFn); }); } }; @@ -234,9 +234,9 @@ function $StateRefDynamicDirective($state: StateService, $timeout: ITimeoutServi if (!type.clickable) return; hookFn = clickHook(element, $state, $timeout, type, function() { return def; }); - element.on("click", hookFn); + element[element.on ? 'on' : 'bind']("click", hookFn); scope.$on('$destroy', function() { - element.off("click", hookFn); + element[element.off ? 'off' : 'unbind']("click", hookFn); }); } };