MCPcopy Create free account
hub / github.com/angular/angular / advanceActivatedRoute

Function advanceActivatedRoute

packages/router/src/router_state.ts:572–598  ·  view source on GitHub ↗
(route: ActivatedRoute)

Source from the content-addressed store, hash-verified

570 * And we detect that by checking if the snapshot field is set.
571 */
572export 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
600export function initializeActivatedRoute(route: ActivatedRoute): void {
601 if (route.paramsSignal !== undefined) {

Callers 4

advanceNodeFunction · 0.90
activateMethod · 0.90
activateRoutesMethod · 0.90

Calls 3

shallowEqualFunction · 0.90
shallowEqualArraysFunction · 0.90
nextMethod · 0.45

Tested by 1

advanceNodeFunction · 0.72