Does anybody know if there's been any breaking changes to the http between alpha 45 and alpha 48? I've been searching around and I didn't find anything. My problem is that the code below was working perfectly on Alpha 45. But now that I've upgraded to Alpha 48 I am getting a _this.http.post(...).map is not a function
error message when I try to run the application. The strange thing is that IntelliSense shows that http.post is returning an observable. Which means that the map function should be available. Any help would be appreciated. Thanks!
public Authenticate(username: string, password: string): Observable<boolean> {
this.ResetAuthenticationValues();
return Observable.create((subscriber: EventEmitter<string>) => {
let body: string = 'grant_type=password&username=' + username + '&password=' + password;
let headers = new Headers();
headers.append('Content-Type', 'application/x-www-form-urlencoded');
this.http.post('http://example.com', body, {headers: headers})
.map(res => res.json())
.subscribe(
(data: DataResponse) => {
if (!data.error) {
this.accessToken = {access_token: data.access_token, token_type: data.token_type};
subscriber.next(this.isAuthenticated = true);
}
else
subscriber.error(this.isAuthenticated = false);
},
(err) => subscriber.error(err),
() => subscriber.complete()
);
return () => { };
});
}