Using bind()
method which is now deprecated in jQuery
#2806
Labels
bind()
method which is now deprecated in jQuery
#2806
The
bind()
andunbind()
methods whichangular.element
implements from the jQuery API are now deprecated in jQuery. In the new slim build of jQuery 3.0 these methods are removed from the code for the first time.This means that if you use the new version of jQuery along with Angular and UI Router, Angular will gracefully let jQuery take over from
angular.element
butbind()
andunbind()
won't be available when UI Router tries to use them for the$StateRefDirective
and$StateRefDynamicDirective
link functions, and functionality will break. See this plunkr (and watch the console for errors):http://plnkr.co/edit/b3pOQKRmuJRS7RyLbDP8?p=preview
(When you select a different state, it won't intercept the route change and a request will go off to the server, wrongly, because it wasn't able to set the event handler up.)
Replacing the (only 2!) usages of
bind()
andunbind()
withon()
andoff()
respectively should fix compatibility with the newest jQuery whilst maintaining compatibility withangular.element
.More than happy to do a PR for this, but will just wait for the nod from a project member.
The text was updated successfully, but these errors were encountered: