Injectable angular http. , http .
@Injectable()
export class Hypermedia {
constructor(private http: Http) { }
get(links: any[], rel: String, body?: any, options?: RequestOptionsArgs): Observable<Response> {
var link = null;
var request = null;
links.forEach(function (_link) {
if (_link.rel === rel) {
link = _link
return;
}
});
return this.http.get(link.href);
}
}
,
constructor(private hypermedia:Hypermedia)
, , http
this.hypermedia.get(myHypermediaLinksArray,myRel)
, :)