Cookies concent notice

This site uses cookies from Google to deliver its services and to analyze traffic.
Learn more
Skip to main content
This site is no longer updated.Head to Angular.devHome
/

This is the archived documentation for Angular v17. Please visit angular.dev to see this page for the current version of Angular.

setUpLocationSync

Sets up a location change listener to trigger history.pushState. Works around the problem that onPopState does not trigger history.pushState. Must be called after calling UpgradeModule.bootstrap.

      
      setUpLocationSync(ngUpgrade: UpgradeModule, urlType: "path" | "hash" = 'path')
    
Parameters
ngUpgrade UpgradeModule

The upgrade NgModule.

urlType "path" | "hash"

The location strategy.

Optional. Default is 'path'.

See also