如果路由器有canActivate()

时间:2017-03-13 12:44:04

标签: angular typescript routing angular2-routing canactivate

嗨我需要在我的检测中检测到溃败已经激活,但无法找到如何做到这一点。

service`

canActivate() {
        this.userLogedin = localStorage.getItem('AUTHENTICATION');

        //I need check here if rout has canActivate

        if (this.userLogedin === 'false') {
            this.router.navigateByUrl('');

            return false;
        }else {
            return true;
        }
    }

0 个答案:

没有答案