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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top