Estou tentando consumir a Api, porém, sempre recebo o mesmo erro.
Error: src/app/app.component.html:3:19 - error TS2339: Property 'url' does not exist on type 'Object'
Error: src/app/app.component.html:4:26 - error TS2339: Property 'description' does not exist on type 'Object'.
app.component.html
<app-photo
*ngFor="let photo of photos"
[url]= "photo.url"
[description]="photo.description"
>
</app-photo>
app.component.ts
import { Component } from '@angular/core';
import { HttpClient } from '@angular/common/http'
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
photos : Object[] = [];
constructor( private httpClient: HttpClient ){
this.httpClient.get<Object[]>("http://localhost:3000/flavio/photos").subscribe(photos => this.photos = photos);
}
}