setUpLocationSync
设置 location 更改监听器以触发 history.pushState
。解决 onPopState
不会触发 history.pushState
的问题。必须在调用 UpgradeModule.bootstrap
之后调用。
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')
参数
ngUpgrade | UpgradeModule | 升级 NgModule。 The upgrade NgModule. |
urlType | "path" | "hash" | location 策略。 The location strategy. 可选. 默认值是 `'path'`. |