Skip to content

Commit e8a0956

Browse files
committed
fix(stateDirective): using on to attach an event handler instead of bind
1 parent 953235a commit e8a0956

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/stateDirectives.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ function $StateRefDirective($state, $timeout) {
145145

146146
if (!type.clickable) return;
147147
hookFn = clickHook(element, $state, $timeout, type, function() { return def; });
148-
element.bind("click", hookFn);
148+
element[element.on ? 'on' : 'bind']("click", hookFn);
149149
scope.$on('$destroy', function() {
150-
element.unbind("click", hookFn);
150+
element[element.off ? 'off' : 'unbind']("click", hookFn);
151151
});
152152
}
153153
};
@@ -197,9 +197,9 @@ function $StateRefDynamicDirective($state, $timeout) {
197197

198198
if (!type.clickable) return;
199199
hookFn = clickHook(element, $state, $timeout, type, function() { return def; });
200-
element.bind("click", hookFn);
200+
element[element.on ? 'on' : 'bind']("click", hookFn);
201201
scope.$on('$destroy', function() {
202-
element.unbind("click", hookFn);
202+
element[element.off ? 'off' : 'unbind']("click", hookFn);
203203
});
204204
}
205205
};

0 commit comments

Comments
 (0)