Issue
I have the following object that I am trying to modify. I want it to have 2 parameters
public headers: any[],
I want the above to have 2 parameters called colName
and tableFilter
Then I want to be able to use it in another file
headerData = { headers: ['', '', ''] };
this.headerData = {
headers: [
{"A", true},
{"B", true},
{"C", true}
]
};
I tried something like this public headers: [{'colName': any, 'tableFilter': boolean }],
but not sure it is right
Solution
The type should be
public headers: {colName: any, tableFilter: boolean }[]
Or
public headers: Array<{colName: any, tableFilter: boolean }>