本文整理匯總了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;
}