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

Function advanceActivatedRoute

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

Source from the content-addressed store, hash-verified

556 * And we detect that by checking if the snapshot field is set.
557 */
558export 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
586export function initializeActivatedRoute(route: ActivatedRoute): void {
587 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