I'm facing a challenge understanding types while working with noImplicitAny and typescript in Angular 6. The compiler is indicating that the type of result is Object, even though I am certain it should be an array of type Manufacturer. Unable to assign the result to my manufacturers array due to TypeScript considering the result as type Object (implicitly any without method signature).
How do I leverage noImplicitAny when I can't control the result's typing? Is it possible?
interface Manufacturer {
key:string;
i18nName: string;
}
public manufacturers:Manufacturer[];
public manufacturersCollapsed: collapse[] = [];
constructor(private http: HttpService) {
}
private getManufacturers() {
this.http.get('manufacturers.json').subscribe(result => {
console.log(result);
this.manufacturers = result;
});
}