本文整理汇总了TypeScript中@angular/common.Location.forward方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Location.forward方法的具体用法?TypeScript Location.forward怎么用?TypeScript Location.forward使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@angular/common.Location
的用法示例。
在下文中一共展示了Location.forward方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: switch
.subscribe(action => {
const { path, query: queryParams, extras = {} }: RouterMethodCall = action.payload;
let commands: any[] = Array.isArray(path) ? path : [path];
switch (action.type) {
case routerActions.GO:
router.navigate(commands, Object.assign({}, extras, { queryParams }));
break;
case routerActions.REPLACE:
router.navigate(commands, Object.assign({}, extras, { queryParams, replaceUrl: true }));
break;
case routerActions.SEARCH:
let urlTree: UrlTree = router.parseUrl(router.url);
urlTree.queryParams = queryParams;
router.navigateByUrl(urlTree, extras);
break;
case routerActions.SHOW:
router.navigate(commands, Object.assign({}, extras, { queryParams, skipLocationChange: true }));
break;
case routerActions.BACK:
location.back();
break;
case routerActions.FORWARD:
location.forward();
break;
}
});
示例2:
this.location.subscribe((v)=>{
if(v.pop){
this.location.forward()
}
})