Are Routes destroyed while transitioning?

I see that only deactivate() hook of the Route class gets invoked while leaving a Route. The willDestroy hook never gets invoked. So are Routes never destroyed in an Ember App? @pzuraq @jenweber

Yes, routes (and controllers) are singletons and are never destroyed. Using deactivate (or one of the other hooks) is the correct way to handle leaving a route!

1 Like

Slight correction… they get destroyed when the application instance is torn down. For fully client side apps, it’s accurate to say “never”, but for FastBoot apps, it means they get torn down when the request ends.

1 Like