I am using PrimeNG datatable. I using httpClient in Angular to fetch some mock data from JSON Placeholder. It appears in my console as an array of objects, however the Visua
If you do not specify the type that is returned from your http request, the http client assumes its an Object
. This is causing the type mismatch error that you are seeing. You are trying to assign type Object
to type any[]
. You can specify the return type by doing
this.http.get<any[]>(this.ROOT_URL).subscribe(...);