**I need assistance with solving this problem. I am encountering an error message and would appreciate some help. The error states: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'Object'.**
import { Injectable } from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {map} from 'rxjs/operators';
import { IProperty } from '../property/IProperty.interface';
import { Observable } from 'rxjs';
@Injectable({
providedIn: 'root'
})
export class HousingService {
constructor(private http: HttpClient) { }
getAllProperties(): Observable<IProperty[]>{
return this.http.get('data/properties.json').pipe(
map(data => {
const propertiesArray: Array<IProperty> = [];
for (const id in data){
if(data.hasOwnProperty(id)) {
propertiesArray.push(data[id]);
}
}
return propertiesArray;
})
);
}
}