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

Function advanceActivatedRoute

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

Source from the content-addressed store, hash-verified

504 * And we detect that by checking if the snapshot field is set.
505 */
506export 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
534export function equalParamsAndUrlSegments(
535 a: ActivatedRouteSnapshot,

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