[Fixed] Modify object to take in another parameter


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


The type should be

public headers: {colName: any, tableFilter: boolean }[]


public headers: Array<{colName: any, tableFilter: boolean }>

Leave a Reply

(*) Required, Your email will not be published