diff --git a/angular-ui-router/angular-ui-router-tests.ts b/angular-ui-router/angular-ui-router-tests.ts index a43f9e9bc..7ceafacd3 100644 --- a/angular-ui-router/angular-ui-router-tests.ts +++ b/angular-ui-router/angular-ui-router-tests.ts @@ -148,6 +148,10 @@ class UrlLocatorTestService implements IUrlLocatorTestService { this.$state.get("myState"); this.$state.get(); this.$state.reload(); + + // Accesses the currently resolved values for the current state + // http://stackoverflow.com/questions/28026620/is-there-a-way-to-access-resolved-state-dependencies-besides-injecting-them-into/28027023#28027023 + var resolvedValues = this.$state.$current.locals.globals; } } diff --git a/angular-ui-router/angular-ui-router.d.ts b/angular-ui-router/angular-ui-router.d.ts index ed2f36ccf..deaa085e8 100644 --- a/angular-ui-router/angular-ui-router.d.ts +++ b/angular-ui-router/angular-ui-router.d.ts @@ -168,6 +168,17 @@ declare module angular.ui { current: IState; params: IStateParamsService; reload(): void; + + $current: IStateServiceUtilities; + } + + interface IStateServiceUtilities { + locals: { + /** + * Currently resolved "resolve" values from the current state + */ + globals: { [key: string]: any; }; + }; } interface IStateParamsService {