-
-
Notifications
You must be signed in to change notification settings - Fork 405
Description
See this twitter discussion for more details, but TL;DR the ability to directly pass a model to link-to / transitionTo may be foot-gunny anti-pattern that could possibly be addressed by an API whereby all models passed to link-to / transitionTo() are parameterized (e.g. converted to numeric/string IDs) so that the model hook is still invoked.
The problem with today's behavior is that it makes it really easy to forget to implement a model hook for when the page is reloaded from URL, because the model hook is skipped when models are directly passed. It is also very confusing to teach/explain the sequence of hooks that are called given this subtle divergence in behavior, and if, in the future, all models were parameterized, we could theoretically condense all beforeModel/model/afterModel hooks into One True Hook™.
So this is a placeholder issue to remind me / anyone that hopefully this idea will turn into a full blown RFC.