constructor(private http: HttpClient) {
}
ngOnInit() {
this.http.get('url').subscribe(data => {
console.log(data);
console.log(data.login);
});
}
}
Here I can see the data logging into the console, but I get an error when the property name does not exist in the data. Is there a workaround for this without using an interface? Because the data I want to get is pretty huge and likely to change in the future, so is there a better way?
source
share