Sitelet https://web.archive.org/web/20240920155602/https://angular.dev/api/router/upgrade/setUpLocationSync/
@angular/router/upgrade

setUpLocationSync

function

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"): void;
  
  
Jump to details