javascript - AngularJS - Run jQuery on route change - Not working -




i have jquery code need run when route changed in single-page angular app.

the app.run function works, because i've added js alert run whenever route changes, , appears correctly, jquery i've tried run on route change doesn't work.

js:

app.run(function($rootscope) { $rootscope.$on('$routechangesuccess', function(event, current, previous) {     console.log('$routechangesuccess: ', current);     alert('route changed');     $('ul.tabs').tabs({         fullwidth: true     });      $('select').material_select();      $('.select-wrapper span.caret').empty().removeclass('caret').addclass('fa').addclass('fa-angle-down');      $('.datepicker').pickadate({         selectmonths: true,         selectyears: 15,         today: 'today',         clear: 'clear',         close: 'cancel',         closeonselect: true,     });      $('.tabs-content').css('height','auto'); }) }) 





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -