fix(router): update type for routerLink to include null and undefined (#37018)

PR #13380 added support for `null` and `undefined` but the type on the parameter was not updated.
This would result in a compilation error if `fullTemplateTypeCheck` is enabled.
Fixes #36544

PR Close #37018
This commit is contained in:
Andrew Scott
2020-05-08 10:55:40 -07:00
committed by Kara Erickson
parent 87f951c5c1
commit ef9f8df9ed
3 changed files with 17 additions and 11 deletions

View File

@ -139,7 +139,7 @@ export class RouterLink {
}
@Input()
set routerLink(commands: any[]|string) {
set routerLink(commands: any[]|string|null|undefined) {
if (commands != null) {
this.commands = Array.isArray(commands) ? commands : [commands];
} else {
@ -229,7 +229,7 @@ export class RouterLinkWithHref implements OnChanges, OnDestroy {
}
@Input()
set routerLink(commands: any[]|string) {
set routerLink(commands: any[]|string|null|undefined) {
if (commands != null) {
this.commands = Array.isArray(commands) ? commands : [commands];
} else {