fix(router): Allow undefined inputs on routerLink (#39151)
This make it coherent with typing of Router.createUrlTree to which those inputs are directly forwarded to. And hence it allow to pass `undefined`, `null` or a value to the routerLink directive. BREAKING CHANGE: in most cases this should not break, but if you were accessing the values of `queryParams`, `fragment` or `queryParamsHandling` you might need to relax the typing to also accept `undefined` and `null`. Signed-off-by: Adrien Crivelli <adrien.crivelli@gmail.com> PR Close #39151
This commit is contained in:
16
goldens/public-api/router/router.d.ts
vendored
16
goldens/public-api/router/router.d.ts
vendored
@ -376,13 +376,11 @@ export declare class RouterEvent {
|
||||
}
|
||||
|
||||
export declare class RouterLink implements OnChanges {
|
||||
fragment: string;
|
||||
fragment?: string;
|
||||
preserveFragment: boolean;
|
||||
/** @deprecated */ set preserveQueryParams(value: boolean);
|
||||
queryParams: {
|
||||
[k: string]: any;
|
||||
};
|
||||
queryParamsHandling: QueryParamsHandling;
|
||||
queryParams?: Params | null;
|
||||
queryParamsHandling?: QueryParamsHandling | null;
|
||||
replaceUrl: boolean;
|
||||
set routerLink(commands: any[] | string | null | undefined);
|
||||
skipLocationChange: boolean;
|
||||
@ -410,14 +408,12 @@ export declare class RouterLinkActive implements OnChanges, OnDestroy, AfterCont
|
||||
}
|
||||
|
||||
export declare class RouterLinkWithHref implements OnChanges, OnDestroy {
|
||||
fragment: string;
|
||||
fragment?: string;
|
||||
href: string;
|
||||
preserveFragment: boolean;
|
||||
/** @deprecated */ set preserveQueryParams(value: boolean);
|
||||
queryParams: {
|
||||
[k: string]: any;
|
||||
};
|
||||
queryParamsHandling: QueryParamsHandling;
|
||||
queryParams?: Params | null;
|
||||
queryParamsHandling?: QueryParamsHandling | null;
|
||||
replaceUrl: boolean;
|
||||
set routerLink(commands: any[] | string | null | undefined);
|
||||
skipLocationChange: boolean;
|
||||
|
Reference in New Issue
Block a user