| 556 | * And we detect that by checking if the snapshot field is set. |
| 557 | */ |
| 558 | export function advanceActivatedRoute(route: ActivatedRoute): void { |
| 559 | if (route.snapshot) { |
| 560 | const currentSnapshot = route.snapshot; |
| 561 | const nextSnapshot = route._futureSnapshot; |
| 562 | route.snapshot = nextSnapshot; |
| 563 | if (!shallowEqual(currentSnapshot.queryParams, nextSnapshot.queryParams)) { |
| 564 | route.queryParamsSubject.next(nextSnapshot.queryParams); |
| 565 | } |
| 566 | if (currentSnapshot.fragment !== nextSnapshot.fragment) { |
| 567 | route.fragmentSubject.next(nextSnapshot.fragment); |
| 568 | } |
| 569 | if (!shallowEqual(currentSnapshot.params, nextSnapshot.params)) { |
| 570 | route.paramsSubject.next(nextSnapshot.params); |
| 571 | } |
| 572 | if (!shallowEqualArrays(currentSnapshot.url, nextSnapshot.url)) { |
| 573 | route.urlSubject.next(nextSnapshot.url); |
| 574 | } |
| 575 | if (!shallowEqual(currentSnapshot.data, nextSnapshot.data)) { |
| 576 | route.dataSubject.next(nextSnapshot.data); |
| 577 | } |
| 578 | } else { |
| 579 | route.snapshot = route._futureSnapshot; |
| 580 | |
| 581 | // this is for resolved data |
| 582 | route.dataSubject.next(route._futureSnapshot.data); |
| 583 | } |
| 584 | } |
| 585 | |
| 586 | export function initializeActivatedRoute(route: ActivatedRoute): void { |
| 587 | if (route.paramsSignal !== undefined) { |