goPersonal不是函数javascript

时间:2018-08-14 11:14:25

标签: javascript angular firebase

如果用户已经登录,我会尝试将用户直接定向到新组件。不幸的是,我总是收到错误消息“ goPersonalData不是函数”。也许有人可以帮助我:

ngOnInit() {
firebase.auth().onAuthStateChanged(function(user) {
  if (user) {
    this.goPersonalData();
  } else {


  }
});

}
onSubmit(form: NgForm) {
const email = form.value.email;
const password = form.value.password;

this.authService.login(email, password);

}
goPersonalData() {
this.router.navigate(['/personalData']);
 }



  }

0 个答案:

没有答案