mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
refactor(core): Add transition.to property to FakeNavigation
This matches the upstream changes in f19930f98a
This commit is contained in:
parent
9dd08c571a
commit
5988bdedae
2 changed files with 7 additions and 1 deletions
|
|
@ -66,6 +66,7 @@ export declare class Navigation extends EventTarget {
|
|||
export declare class NavigationTransition {
|
||||
readonly navigationType: NavigationTypeString;
|
||||
readonly from: NavigationHistoryEntry;
|
||||
readonly to: NavigationDestination;
|
||||
readonly finished: Promise<void>;
|
||||
readonly committed: Promise<void>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1020,7 +1020,11 @@ function dispatchNavigateEvent({
|
|||
);
|
||||
return;
|
||||
}
|
||||
const transition = new InternalNavigationTransition(navigation.currentEntry, navigationType);
|
||||
const transition = new InternalNavigationTransition(
|
||||
navigation.currentEntry,
|
||||
event.destination,
|
||||
navigationType,
|
||||
);
|
||||
navigation.transition = transition;
|
||||
// Mark transition.finished as handled (Spec Step 33.4)
|
||||
transition.finished.catch(() => {});
|
||||
|
|
@ -1227,6 +1231,7 @@ class InternalNavigationTransition implements NavigationTransition {
|
|||
committedReject!: (reason: Error) => void;
|
||||
constructor(
|
||||
readonly from: NavigationHistoryEntry,
|
||||
readonly to: NavigationDestination,
|
||||
readonly navigationType: NavigationTypeString,
|
||||
) {
|
||||
this.finished = new Promise<void>((resolve, reject) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue