質問

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