mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-18 12:33:17 +08:00
Merge pull request #7300 from Burgov/urlroutermethods
add some methods defined on the UrlRouter service
This commit is contained in:
@@ -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, {}, {});
|
||||
});
|
||||
}
|
||||
|
||||
5
angular-ui-router/angular-ui-router.d.ts
vendored
5
angular-ui-router/angular-ui-router.d.ts
vendored
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user