fix(router): Use T type in Resolve interface (#13242)
This commit is contained in:
parent
65965c27a8
commit
9591a08dfb
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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; }
|
||||
}
|
||||
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue