fix(router): Use T type in Resolve interface (#13242)

This commit is contained in:
Jónatan Núñez 2016-12-08 20:24:38 +01:00 committed by Victor Berchet
parent 65965c27a8
commit 9591a08dfb
3 changed files with 3 additions and 4 deletions

View File

@ -305,8 +305,7 @@ export interface CanDeactivate<T> {
* @stable
*/
export interface Resolve<T> {
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot):
Observable<any>|Promise<any>|any;
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<T>|Promise<T>|T;
}

View File

@ -780,7 +780,7 @@ describe('Integration', () => {
})));
describe('data', () => {
class ResolveSix implements Resolve<TeamCmp> {
class ResolveSix implements Resolve<number> {
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): number { return 6; }
}

View File

@ -172,7 +172,7 @@ export declare function provideRoutes(routes: Routes): any;
/** @stable */
export interface Resolve<T> {
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<any> | Promise<any> | any;
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<T> | Promise<T> | T;
}
/** @stable */