I would like to know what's the appropriate method for perfoming a JSONP get call. In this instance, my JSONP url is listed under myRun
as you can see in this link.
import { Injectable } from '@angular/core';
import { Http, Response } from '@angular/http';
import { Observable } from 'rxjs/Rx';
@Injectable()
export class AppService {
constructor(private http: Http){}
fetchData(){
return this.http.get('http://dev.markitondemand.com/MODApis/Api/v2/Quote/jsonp?symbol=AAPL&callback=myRun').map(
(res) => res.json()
).subscribe(
(data) => console.log(data)
);
}
}
I've seen examples that use JSONP_PROVIDERS
, but I believe they are deprecated by now. Thus, I am wondering what the up-to-date method is for making a JSONP get request.