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 {}

Author of content
Edit this page

Made by Michael Sakhniuk

Twitter