I am new to typescript/angulat. I already have a constructor fetching JsonP. I want to create a new constructor for HttpClientModule. This is my current code.
export class DataService {
constructor(private _jsonp: Jsonp) {
this.apikey = 'xxx';
}
}
This is what I tried..
export class DataService {
constructor(private _jsonp: Jsonp, private http: HttpClient) {
this.apikey = 'xxx';
}
}
The first json api stops working. I want something equivalent to this
export class DataService {
constructor(private _jsonp: Jsonp) {
this.apikey = 'xxx';
}
constructor(http: HttpClient) {}
}