-
Notifications
You must be signed in to change notification settings - Fork 26.8k
Closed
Description
since I updated to alpha 48, http.get(...).map is no longer working.
EXCEPTION: TypeError: json.map is not a function in [null]
@Injectable()
export class WPService implements IWPService {
baseURL: string = 'http://localhost/wptest/api';
http: Http;
constructor(http: Http) {
this.http = http;
}
GetPosts() {
var query = this.baseURL + '/get_posts/';
return new JsonObject(this.http.get(query));
}
}
@Injectable()
export class JsonObject {
constructor(json: Observable<any>) {
json.map(res => res.json()).map(data => { // <=
for (var entry in data) {
if (data.hasOwnProperty(entry)) {
this[entry] = data[entry];
}
}
}).subscribe();
}
}
when I downgraded to alpha 47, .map worked again. maybe it has something to do with the integrated rxjs
feijin, sarawutymtz and DavidDuwaercostel-petrescu
Metadata
Metadata
Assignees
Labels
No labels