- Should you use a separate controller like sessionController, and pass around the desired variables to other controllers using the
needs:
hook?
This seems like it would get very un-DRY very quickly.
A simple internal variable like #1 won't get reflected in the URL. You can save it to the database but that seems costly and silly for something that gets changed frequently as part of the app experience, as opposed to an infrequently changed user setting.
It seems the best way is to reflect the state in the URL one way or another.
- Or should you have a dynamic segment as the parent url segment to all your routes?
If you go with option 2, how do you obtain and remember the subroute url segments when using transitionTo or link-to?
- or should you change the query parameters in such a way that it sets it regardless of what route you may be in?
Would this cause conflicts or management hassles if you're using other query parameters, or can you cleanly append and remove individual query parameters?
Or is there another better way to handle such things?
Aucun commentaire:
Enregistrer un commentaire