written html as
<ng-container matColumnDef="AppointmentDate">
<mat-header-cell *matHeaderCellDef mat-sort-header> Date </mat-header-cell>
<mat-cell *matCellDef="let row" appColordirective> {{row.appointmentDate|date: "yyyy-MM-dd"}} </mat-cell>
</ng-container>
I want to provide it green color when date matches with todays date. My directive code is ,
import { Directive, ElementRef,Input, OnInit } from '@angular/core';
@Directive({
selector: '[appColordirective]'
})
export class ColordirectiveDirective implements OnInit {
constructor(private element: ElementRef) {
this.element.nativeElement.style.backgroundColor ="green";
}
ngOnInit(): void {
}
}
```
any one please guide on this.