Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular Firebase在注册/注册后未重定向到仪表板_Angular_Firebase_Authentication_Redirect - Fatal编程技术网

Angular Firebase在注册/注册后未重定向到仪表板

Angular Firebase在注册/注册后未重定向到仪表板,angular,firebase,authentication,redirect,Angular,Firebase,Authentication,Redirect,我替换了此代码(这是我的signup.component.ts): 为此: private signupSuccess(){ this.router.navigateByUrl('/dashboard'); } 这就是我的isloggedin的样子(authentication.guard.ts): Router.navigateByUrl在其参数中接受字符串,并且导航应该是绝对的,并且以/:private signupSuccess()开头({this.Router.navigateByU

我替换了此代码(这是我的signup.component.ts):

为此:

private signupSuccess(){
this.router.navigateByUrl('/dashboard');

}
这就是我的isloggedin的样子(authentication.guard.ts):


Router.navigateByUrl在其参数中接受字符串,并且导航应该是绝对的,并且以/:private signupSuccess()开头({this.Router.navigateByUrl('/dashboard;src=signup');}您好@Gopal,感谢您的回复!但是你所说的绝对是什么意思,它应该从你发送的代码行开始。。。我写了你发送的内容,但我仍然被成功注册的提示卡住了
private signupSuccess(){
this.router.navigateByUrl('/dashboard');

}
  canActivate(
    next: ActivatedRouteSnapshot,
    state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
    if(this.authService.isLoggedIn)
      return true
    else
      return this.router.parseUrl("/dashboard");
  }
return this.router.parseUrl("/dashboard");