From e8a09560f80da062f58e7548e91308dd416d3bcb Mon Sep 17 00:00:00 2001 From: Axel Navarro Date: Sun, 25 Sep 2016 19:43:00 -0300 Subject: [PATCH] fix(stateDirective): using on to attach an event handler instead of bind --- src/stateDirectives.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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); }); } };