Reputation: 132
I have primeng turbo table which can have indefinite number of rows. I have a column "IsActive" that needs to be shown in all rows. I need to use p-inputswitch for "IsActive" column. The issue I am facing is how do I implement p-inputswitch for these many rows.
Ideas: I was thinking to bind value for each column using ngModel where its name will be generated using 'isActive'+ rowid. E.g [(ngModel)] = isActive1 for first row AND [(ngModel)] = isActive2 for second row AND [(ngModel)] = isActive3 for third row and so on and reading these values in .ts file. The complexity is because of indefinite number of rows(lots of 'isActive+n:boolean' should be defined in .ts file which I do not prefer opting for.)
What is best way to achieve it?
Upvotes: 0
Views: 1401