That pattern you described is likely to break as soon as someone tries to refresh the page on the config
route. Passing the model to transitionTo
will skip the model()
hook, but then if users refresh directly while they’re already on the config
route, the model()
hook is going to run and need to know what to do on its own. It needs to call createConfig
.
If createConfig
is complicated but stateless, make it a separate library function that’s imported by all the places that need it. If it’s stateful, put it on a Service.