tushar-borole / angular-nicescroll

:full_moon_with_face: nicescroll directive for angular js, adding the custom scroll with infinite scrolling becomes very easy in angular js
http://tushariscoolster.github.io/angular-nicescroll
64 stars 26 forks source link

how to remove the Dom ".nicescroll-rails" #10

Open LunaYJ opened 8 years ago

LunaYJ commented 8 years ago

Hi there, u see I made a SPA with Angular. and in my web , I only use niceScroll in profile Page. but now I meet a problem. When I entry profile page, then I back to index page, I check in Chrome I find ".nicescroll-rails" this DOM notremoved, and then I entry profile page again, a new ".nicescroll-rails" Dom was created.... so I checked Elements with Chrome Dev Tools, I can see 4 '.nicescroll-rails' Doms, 2 of them Display are None, and the other 2 are Block.

so If I entry profile page many many times , and '.nicescroll-rails' Dom will be created many many

So I wanna Know, What can I do? and How can I set, when I leave profile page, '.nicescroll-rails' will remove, or when I entry profile page, '.nicescroll-rails' only be created one