How do you upgrade location service of angularjs?

If you are using $location service in your old AngularJS application, now you can use LocationUpgradeModule(unified location service) which puts the responsibilities of $location service to Location service in Angular. Let's add this module to AppModule as below,

// Other imports ...
import { LocationUpgradeModule } from '@angular/common/upgrade';
@NgModule({
imports: [
// Other NgModule imports...
LocationUpgradeModule.config(),
],
})
export class AppModule {}

September 12, 2022
220