Angular 2 rc 1 canActivate [英] Angular 2 rc 1 canActivate

查看:40
本文介绍了Angular 2 rc 1 canActivate的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

新的rc路由器中是否有类似@CanActivate之类的东西,或者如果无法激活,我是否必须使用routerOnActivate并返回原位?

Is there some similar like @CanActivate in the new rc router or do I have to use routerOnActivate and navigate back if it is not activable?

致谢

推荐答案

截至2016年5月15日的答案是,当前版本候选版本中未实现@CanActivate功能,除了使用router-deprecated或切换到备用路由器外像ngrx这样的实现,除了等待之外真的没有其他事情要做.

The answer as of 15 May 2016 is that @CanActivate functionality is currently not implemented in the release candidate and other than using router-deprecated or switching to an alternate router implementation such as ngrx there really isn't anything to do other than wait.

这是一个需要解决的公开问题: https://github.com/angular/angular/issues/8655

Here's an open issue asking for a solution: https://github.com/angular/angular/issues/8655

这是一个文档,我花了很多时间才能找到哪些话题建议的路由器重构(您可以在文档中找到@CanActivate的内容).

Here is a document which took me ages to find which talks about the proposed router refactorings (you can find mention of @CanActivate in the doc).

这篇关于Angular 2 rc 1 canActivate的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆