문제

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