From d5e1c4b1f5283ed68e3407f9cefb1266af0fbfbe Mon Sep 17 00:00:00 2001 From: Ben Loveridge Date: Thu, 7 Jan 2016 14:07:07 -0700 Subject: [PATCH] Support more variations of IStateService.get --- angular-ui-router/angular-ui-router-tests.ts | 7 ++++++- angular-ui-router/angular-ui-router.d.ts | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/angular-ui-router/angular-ui-router-tests.ts b/angular-ui-router/angular-ui-router-tests.ts index 41661d60d..07711b9b8 100644 --- a/angular-ui-router/angular-ui-router-tests.ts +++ b/angular-ui-router/angular-ui-router-tests.ts @@ -177,8 +177,13 @@ class UrlLocatorTestService implements IUrlLocatorTestService { if (this.$state.href("myState") === "/myState") { // } - this.$state.get("myState"); this.$state.get(); + this.$state.get("myState"); + this.$state.get("myState", "yourState"); + this.$state.get("myState", this.$state.current); + this.$state.get(this.$state.current); + this.$state.get(this.$state.current, "yourState"); + this.$state.get(this.$state.current, this.$state.current); this.$state.reload(); // http://angular-ui.github.io/ui-router/site/#/api/ui.router.state.$state#properties diff --git a/angular-ui-router/angular-ui-router.d.ts b/angular-ui-router/angular-ui-router.d.ts index a22b7d0da..324ec676c 100644 --- a/angular-ui-router/angular-ui-router.d.ts +++ b/angular-ui-router/angular-ui-router.d.ts @@ -261,7 +261,10 @@ declare module angular.ui { is(state: IState, params?: {}): boolean; href(state: IState, params?: {}, options?: IHrefOptions): string; href(state: string, params?: {}, options?: IHrefOptions): string; - get(state: string): IState; + get(state: string, context?: string): IState; + get(state: IState, context?: string): IState; + get(state: string, context?: IState): IState; + get(state: IState, context?: IState): IState; get(): IState[]; /** A reference to the state's config object. However you passed it in. Useful for accessing custom data. */ current: IState;