本文整理汇总了TypeScript中@ngrx/router-store.go函数的典型用法代码示例。如果您正苦于以下问题:TypeScript go函数的具体用法?TypeScript go怎么用?TypeScript go使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了go函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
.map(entity => {
if (!entity) {
this.store.dispatch(go(['404']));
return false;
}
return entity.Role === 'Administrators';
});
示例2:
.map(entities => {
if (!entities || !entities[id]) {
this.store.dispatch(go(['404']));
return false;
}
return true;
});
示例3: ngOnInit
ngOnInit() {
this.translate.get('authorize_btn').subscribe(value => {
this.store.dispatch({ type: BreadcrumbActions.BREADCRUMBS_UPDATED, payload: [{ title: value, navigationLink: '' }] });
});
if (this.vkservice.hasValidSession()) {
this.store.dispatch(go(['dialogs']));
}
}
示例4:
return this.store.let(fromRoot.getIsLogged).do(v => {
if (v) return;
if (localStorage.getItem('refreshToken')) {
this.store.dispatch(new authAction.RefreshAction(replace(url)));
}
else {
console.log('auth failed');
this.store.dispatch(go('/auth'));
}
});
示例5:
this.vkservice.auth().subscribe(() => {
console.log('authorization completed, go to dialogs');
this.store.dispatch(go(['dialogs']));
});
示例6:
return this.store.select(fromRoot.getAuthEntity).map(entity => {
if (!entity) this.store.dispatch(go(['home']));
return !!entity
});
示例7: canActivate
canActivate() {
if (window.localStorage.getItem(VKConsts.userDenied) === 'true' || !this.login.hasValidSession()) {
this.store.dispatch(go(['authorize']));
}
return true;
}