diff --git a/angular-ui-router/angular-ui-router-tests.ts b/angular-ui-router/angular-ui-router-tests.ts index 3211faee5c..41661d60d5 100644 --- a/angular-ui-router/angular-ui-router-tests.ts +++ b/angular-ui-router/angular-ui-router-tests.ts @@ -230,7 +230,7 @@ module UrlRouterProviderTests { // this allows you to configure custom behavior in between // location changes and route synchronization: $urlRouterProvider.deferIntercept(); - }).run(($rootScope: ng.IRootScopeService, $urlRouter: ng.ui.IUrlRouterService, UserService: ITestUserService) => { + }).run(($rootScope: ng.IRootScopeService, $urlRouter: ng.ui.IUrlRouterService, UserService: ITestUserService, $urlMatcher: ng.ui.IUrlMatcher) => { $rootScope.$on('$locationChangeSuccess', e => { // UserService is an example service for managing user state if (UserService.isLoggedIn()) return; @@ -245,6 +245,18 @@ module UrlRouterProviderTests { }); // Configures $urlRouter's listener *after* your custom listener - $urlRouter.listen(); + var listen: Function = $urlRouter.listen(); + + var href: string; + href = $urlRouter.href($urlMatcher); + href = $urlRouter.href($urlMatcher, {}); + href = $urlRouter.href($urlMatcher, {}, {}); + + $urlRouter.update(); + $urlRouter.update(false); + + $urlRouter.push($urlMatcher); + $urlRouter.push($urlMatcher, {}); + $urlRouter.push($urlMatcher, {}, {}); }); } diff --git a/angular-ui-router/angular-ui-router.d.ts b/angular-ui-router/angular-ui-router.d.ts index 257446f694..a22b7d0da3 100644 --- a/angular-ui-router/angular-ui-router.d.ts +++ b/angular-ui-router/angular-ui-router.d.ts @@ -300,7 +300,10 @@ declare module angular.ui { * */ sync(): void; - listen(): void; + listen(): Function; + href(urlMatcher: IUrlMatcher, params?: IStateParamsService, options?: IHrefOptions): string; + update(read?: boolean): void; + push(urlMatcher: IUrlMatcher, params?: IStateParamsService, options?: IHrefOptions): void; } interface IUiViewScrollProvider {