I have an array of objects that are within my <mat-table>
the sync property is a <mat-checkbox>
. I am trying to make it so that when a box is checked and then I press the "sync" button, it will update the lastSynced property with the current date and time within the table.
export interface ConnectionData {
name: string;
active: boolean;
connections: string;
location: string;
users: string;
sync: boolean;
lastSynced: Date | null;
}
const CONNECTIONS: ConnectionData[] = [
{name: '', active: false, connections: '', location: '', users: '', sync: false, lastSynced: },
{name: '', active: false, connections: '', location: '', users: '', sync: false, lastSynced: },{name: '', active: false, connections: '', location: '', users: '', sync: false, lastSynced: },
];
Have the method that's called on the sync buttons (click) that updates the table data. Something like: