Add access to $state.$current.locals.globals

This commit is contained in:
Matt DeKrey
2015-07-27 16:08:33 -04:00
parent db3a54c801
commit 4f162bfd4b
2 changed files with 15 additions and 0 deletions
@@ -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;
}
}
+11
View File
@@ -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 {