I am trying to loop through my data source objects by doing something like:
this.datasource.data.forEach()
but it doesn't recognize my data is an array of objects so I try this:
const objects: ObjectModel[] = this.datasource.data
and then I get the following error:
object type is assignable to very few other types
How can I be able to do a forEach on the datasource data?
Updated to include model definition:
ObjectModel = {
id: string,
firstName: string,
lastName: string
}
datalooks like. Without this, we will not be able to answer your question. - Chris Knightbut it doesn't recognise my data is an array of objects- Chris Knight