mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
|
|
||
|---|---|---|
| .. | ||
| BUILD.bazel | ||
| index.ts | ||
| README.md | ||
| router_current_navigation_migration.ts | ||
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();
}
}