My map function in this code block:
public async getAllWidgets2(): Promise<Widget[]> {
let url = "myUrl";
var items = [];
return axios.get(url).then(result => {
console.log("results" + result)
let result2: Widget[] = [];
result.map((item) => { result2.push(this.parseWidget(item)); });
let data: Widget[] = result2;
return(data);
} ) }
The map functions above gives me an error "Property 'map' does not exist on type 'AxiosResponse'.ts(2339)"
I searched on answers on StackOverflow and tried:
import { map } from 'rxjs/operators';
But still gives me the same error. Any way to solve it?