InterviewHubPRO
Section Overview
Q147

Question 147 of 283

Part 6: Decorators, Dependency Injection & Tooling (124 - 150)

52%
Angular & Signals (283 Qs)•Part 6: Decorators, Dependency Injection & Tooling (124 - 150)

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,

javascript
// Other imports ...
import { LocationUpgradeModule } from '@angular/common/upgrade';

@NgModule({
imports: [
  // Other NgModule imports...
  LocationUpgradeModule.config()
]
})
export class AppModule {}