| 504 | * And we detect that by checking if the snapshot field is set. |
| 505 | */ |
| 506 | export function advanceActivatedRoute(route: ActivatedRoute): void { |
| 507 | if (route.snapshot) { |
| 508 | const currentSnapshot = route.snapshot; |
| 509 | const nextSnapshot = route._futureSnapshot; |
| 510 | route.snapshot = nextSnapshot; |
| 511 | if (!shallowEqual(currentSnapshot.queryParams, nextSnapshot.queryParams)) { |
| 512 | route.queryParamsSubject.next(nextSnapshot.queryParams); |
| 513 | } |
| 514 | if (currentSnapshot.fragment !== nextSnapshot.fragment) { |
| 515 | route.fragmentSubject.next(nextSnapshot.fragment); |
| 516 | } |
| 517 | if (!shallowEqual(currentSnapshot.params, nextSnapshot.params)) { |
| 518 | route.paramsSubject.next(nextSnapshot.params); |
| 519 | } |
| 520 | if (!shallowEqualArrays(currentSnapshot.url, nextSnapshot.url)) { |
| 521 | route.urlSubject.next(nextSnapshot.url); |
| 522 | } |
| 523 | if (!shallowEqual(currentSnapshot.data, nextSnapshot.data)) { |
| 524 | route.dataSubject.next(nextSnapshot.data); |
| 525 | } |
| 526 | } else { |
| 527 | route.snapshot = route._futureSnapshot; |
| 528 | |
| 529 | // this is for resolved data |
| 530 | route.dataSubject.next(route._futureSnapshot.data); |
| 531 | } |
| 532 | } |
| 533 | |
| 534 | export function equalParamsAndUrlSegments( |
| 535 | a: ActivatedRouteSnapshot, |