【发布时间】:2023-04-01 22:29:02
【问题描述】:
当我尝试从 Angular Web 应用服务的 ionic 提供程序中添加 api 连接部分时,它显示 Expected 0 arguments but got 1 in here:
@Injectable({
providedIn: 'root'
})
虽然在 Angular Web 项目中也是如此。
Ionic3 提供程序如下所示:
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
const BASEURL = 'http://domain...';
@Injectable({
providedIn: 'root'
})
export class AuthProvider {
constructor(private http: HttpClient) { }
RegisterUser(body): Observable<any> {
return this.http.post(`${BASEURL}/register`, body);
}
LoginUser(body): Observable<any> {
return this.http.post(`${BASEURL}/login`, body);
}
}
如何解决这个问题?
【问题讨论】:
标签: angular typescript ionic-framework ionic3 angular6