【发布时间】:2018-09-06 12:51:45
【问题描述】:
我开始使用 Angular 5 模板并将其转换为 Ang 6。 https://github.com/mmacneil/AngularASPNETCore2WebApiAuth
我知道 RxJS 发生了变化,例如RxJS v5.x 到 v6。 那么我如何将此代码转换为 v6,因为 .map 已完全更改。
register(email: string, password: string, firstName: string, lastName: string,location: string, gender:string, birthDate:any): Observable<UserRegistration> {
let body = JSON.stringify({ email, password, firstName, lastName,location,gender,birthDate });
let headers = new Headers({ 'Content-Type': 'application/json' });
let options = new RequestOptions({ headers: headers });
return this.http.post(this.baseUrl + "/accounts", body, options)
.map(res => true)
.catch(this.handleError);
}
用户注册
export interface UserRegistration {
email: string;
password: string;
firstName: string;
lastName: string;
location: string;
birthDate: any;
gender: string;
}
【问题讨论】: