I am calling 2 GitHub API's but i am getting above error when I am printing the response in the console. I googled the error and tried fixing it by creating proxy.json file and modifying package.json file but it doesn't fix the error.
export class HomeComponent implements OnInit {
pythonJD:any[];
javaJD:any[];
constructor(private service: GithubService) { }
ngOnInit() {
this.python()
this.java()
}
python() {
this.service.getPython().subscribe(res => {
this.pythonJD = res;
console.log(res)
});
}
java() {
this.service.getJava().subscribe(res => {
this.javaJD = res;
console.log(res)
});
}
}
export class GithubService {
constructor(private http:HttpClient) { }
getPython():Observable<any>{
return this.http.get('https://jobs.github.com/positions.json?description=python&location=new+york');
}
getJava():Observable<any>{
return this.http.get('https://jobs.github.com/positions.json?description=java&location=new+york');
}
}