Question

What are the posible ways for sharing resource objects through state controllers. I am using $rootScope, state inheritance or factories (services). Is there any other ways to send resource objects to other controllers on state changes?

Was it helpful?

Solution

If you're trying to coordinate complex transactions on the same object (or set of objects) across multiple controllers, then services are definitely the way to go. However, the master branch of UI Router implements typed parameters, which allow URL parameters to be converted to complex objects and exposed on $stateParams.

Any controller that access to parameter values on $stateParams will have access to the parameter objects.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top