Angular 8: What are some changes in Location module?

Technology CommunityCategory: AngularAngular 8: What are some changes in Location module?
VietMX Staff asked 3 years ago

To help people migrating from AngularJS, a bunch of things have been added to the location services in Angular 8.

  • PlatformLocation now offers access to the hostname, port and protocol, and a new getState() method allows to get the history.state.
  • MockPlatformLocation is also available to ease testing.

All this is really useful if you are using ngUpgrade, otherwise you probably won’t need it.