angular/packages/core/schematics/migrations/router-current-navigation
Joey Perrott 9a27c5befb build: rename defaults2.bzl to defaults.bzl (#63384)
Use defaults.bzl for the common macros

PR Close #63384
2025-08-25 15:45:46 -07:00
..
BUILD.bazel build: rename defaults2.bzl to defaults.bzl (#63384) 2025-08-25 15:45:46 -07:00
index.ts feat(router): add a currentNavigation signal to the Router service. (#63011) 2025-08-06 09:54:53 -07:00
README.md feat(router): add a currentNavigation signal to the Router service. (#63011) 2025-08-06 09:54:53 -07:00
router_current_navigation_migration.ts feat(router): add a currentNavigation signal to the Router service. (#63011) 2025-08-06 09:54:53 -07:00

Remove Router.getCurrentNavigation migration

Replaces the usages of the deprecated Router.getCurrentNavigation method with the new Router.currentNavigation() signal:

Before

import { Router } from '@angular/router';

export class MyService {
  router = inject(Router);   

  someMethod() {
    const currentNavigation = this.router.getCurrentNavigation();
  }
}

After

import { Router } from '@angular/router';

export class MyService {
  router = inject(Router);   

  someMethod() {
    const currentNavigation = this.router.currentNavigation();
  }
}