| 570 | * And we detect that by checking if the snapshot field is set. |
| 571 | */ |
| 572 | export function advanceActivatedRoute(route: ActivatedRoute): void { |
| 573 | if (route.snapshot) { |
| 574 | const currentSnapshot = route.snapshot; |
| 575 | const nextSnapshot = route._futureSnapshot; |
| 576 | route.snapshot = nextSnapshot; |
| 577 | if (!shallowEqual(currentSnapshot.queryParams, nextSnapshot.queryParams)) { |
| 578 | route.queryParamsSubject.next(nextSnapshot.queryParams); |
| 579 | } |
| 580 | if (currentSnapshot.fragment !== nextSnapshot.fragment) { |
| 581 | route.fragmentSubject.next(nextSnapshot.fragment); |
| 582 | } |
| 583 | if (!shallowEqual(currentSnapshot.params, nextSnapshot.params)) { |
| 584 | route.paramsSubject.next(nextSnapshot.params); |
| 585 | } |
| 586 | if (!shallowEqualArrays(currentSnapshot.url, nextSnapshot.url)) { |
| 587 | route.urlSubject.next(nextSnapshot.url); |
| 588 | } |
| 589 | if (!shallowEqual(currentSnapshot.data, nextSnapshot.data)) { |
| 590 | route.dataSubject.next(nextSnapshot.data); |
| 591 | } |
| 592 | } else { |
| 593 | route.snapshot = route._futureSnapshot; |
| 594 | |
| 595 | // this is for resolved data |
| 596 | route.dataSubject.next(route._futureSnapshot.data); |
| 597 | } |
| 598 | } |
| 599 | |
| 600 | export function initializeActivatedRoute(route: ActivatedRoute): void { |
| 601 | if (route.paramsSignal !== undefined) { |