mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
6270bba056
This is after we've slightly changed a rule in #66056
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();
}
}