mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
refactor(router): Add back changes param to RouterLink ngOnChanges (#56371)
This parameter was removed in a recent change but is being added back to avoid breaking code in a minor version. While the changes parameter is not used, some code relies on it, mostly through API misuse (extending `RouterLink`, manually calling `ngOnChanges`, etc.). PR Close #56371
This commit is contained in:
parent
3cbddd2e42
commit
4efe5000c0
2 changed files with 4 additions and 2 deletions
|
|
@ -810,7 +810,7 @@ class RouterLink implements OnChanges, OnDestroy {
|
|||
// (undocumented)
|
||||
static ngAcceptInputType_skipLocationChange: unknown;
|
||||
// (undocumented)
|
||||
ngOnChanges(): void;
|
||||
ngOnChanges(changes?: SimpleChanges): void;
|
||||
// (undocumented)
|
||||
ngOnDestroy(): any;
|
||||
// (undocumented)
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import {
|
|||
OnDestroy,
|
||||
Renderer2,
|
||||
ɵRuntimeError as RuntimeError,
|
||||
SimpleChanges,
|
||||
ɵɵsanitizeUrlOrResourceUrl,
|
||||
} from '@angular/core';
|
||||
import {Subject, Subscription} from 'rxjs';
|
||||
|
|
@ -260,7 +261,8 @@ export class RouterLink implements OnChanges, OnDestroy {
|
|||
}
|
||||
|
||||
/** @nodoc */
|
||||
ngOnChanges() {
|
||||
// TODO(atscott): Remove changes parameter in major version as a breaking change.
|
||||
ngOnChanges(changes?: SimpleChanges) {
|
||||
if (
|
||||
ngDevMode &&
|
||||
isUrlTree(this.routerLinkInput) &&
|
||||
|
|
|
|||
Loading…
Reference in a new issue