iron router - Meteor Route.go() is keeping all the previous JS code -


i noticed when route.go() in meteor, keeps of previous page's template handlers/events/render js code.

for example, on previous page before route.go(), had setinterval(...) running @ every x seconds.

after route.go(), setinterval continued fire, because required elements no longer there, kept generating errors.

is design? how can route , start fresh?

note: true clicking link well, since technically that's route (if link created route)

using router.go not analogous clicking hyperlink or issuing server-side redirect.

it's common expect route.go act non-bound hyperlink (i.e. physically issue new request), or issue server-side 301, that's not how iron router works.

it handle route within current loaded window environment, typically making use of html5 pushstate swap out url handle route internal meteor.

this means existing setintervals or other "global" events continue run unless stop handler explicitly.


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -