• 概要
@angular/router/upgrade

setUpLocationSync

function
stable

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.

API

function setUpLocationSync(
  ngUpgrade: UpgradeModule,
  urlType?: 'path' | 'hash',
): void;

setUpLocationSync

void

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.

@paramngUpgradeUpgradeModule

The upgrade NgModule.

@paramurlType"path" | "hash"

The location strategy.

@returnsvoid
Jump to details