I have forget-password (/forget-password) and reset-password (/reset-password/:token) route. They share some logic but their urls are not nested. Thus, I cannot use parent route to define those shared logic.
Would create a route with those shared logic and inherit it to create forget-password and reset-password routes be the best way to share logic here?
virtual is just a description; just declare it like a normal route
// non ES6 syntax
// this route doesn't actually exist in your router
// it serves as ancestor for the two real routes
App.PasswordRoute = Ember.Route.extend({
// shared logic ...
});
App.ForgetPasswordRoute = App.PasswordRoute.extend({
// specific logic
});
App.ResetPasswordRoute = App.PasswordRoute.extend({
// specific logic
});