错误TypeError:无法读取未定义的属性'tokenGetter'
我在调用http请求时遇到了错误
登录组件代码
this.userData.login(this.loginForm.value).subscribe(data => {
this.user = data;
console.log('USER DATA : '+ this.user);
});
用户服务代码
public login(userData: User): Observable<User> {
console.log('USER DATA SERVICE');
return this.http.post<User>(`${this.apiUrl}/userlogin.php`, userData);
// return this.http.get<User>(`${this.apiUrl}/userlogin.php?username=${username}&password=${password}`).pipe(
// catchError(this.handleError)
// );
}