问题描述
我在Angular 6中有一个具有以下功能的ApiService:
add(data,string: string,type): Observable<Object | Response> {
return this._http.post(this.url + string,data).pipe(
tap(() => this.log(`added ${type} successfully`)),catchError(this.handleError<Response>(`Adding ${type}`))
);
}
this.api.add(this.parent,'parents/new','Parent').subscribe(() => {
this.authService.login(this.user,'login').subscribe();
this.router.navigate(['/register/student']);
});
即使我已订阅Observable,对api的调用也完全不会触发。请帮我。谢谢
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)