How to share controller instance/state across aliased routes.
Closed this issue · 1 comments
Hi, great lib. Super useful.
I am running into an issue where I need controller state to persist across transitions between aliased routes. As far as I can tell, right now, the individual aliased routes get instances of the same controller, but they do not share the same instance of the controller.
Is this possible to do? if not, have you run into this issue? did you solve it?
I imagine I will need to use the setupController
and resetController
methods to persist state when transitioning between aliased routes, but I cannot think of an elegant way to do this, perhaps persisting it in a service.
Going to close this as I don't want to make too much noise, but what I really needed here was the ability to have multiple paths map to the exact same route/controller/template (same instance, not just instances of the same).
I will look into ember router internals and try to see why this is not trivially possible. I see no reason why it should not except some convention or opinion.