diff --git a/src/stateDirectives.js b/src/stateDirectives.js index e97da32b4..b6269dc65 100644 --- a/src/stateDirectives.js +++ b/src/stateDirectives.js @@ -145,9 +145,9 @@ function $StateRefDirective($state, $timeout) { if (!type.clickable) return; hookFn = clickHook(element, $state, $timeout, type, function() { return def; }); - element.bind("click", hookFn); + element[element.on ? 'on' : 'bind']("click", hookFn); scope.$on('$destroy', function() { - element.unbind("click", hookFn); + element[element.off ? 'off' : 'unbind']("click", hookFn); }); } }; @@ -197,9 +197,9 @@ function $StateRefDynamicDirective($state, $timeout) { if (!type.clickable) return; hookFn = clickHook(element, $state, $timeout, type, function() { return def; }); - element.bind("click", hookFn); + element[element.on ? 'on' : 'bind']("click", hookFn); scope.$on('$destroy', function() { - element.unbind("click", hookFn); + element[element.off ? 'off' : 'unbind']("click", hookFn); }); } };