I am straggling to set the date and time of my input field of type datetime-local in Angular to the current time. Below is the section of my template html file. <form [formGroup]="form" (ngSubmit)="onSubmit()" *ngIf="isLoaded && !isAdmin"> <div class="form-row"> <div class="form-group col-5"> <label>Date</label> <input type="datetime-local" formControlName="scheduledDate" class="form-control" /> </div> </div> </form> I have tried the suggestion given on stackblitz Here but it gives me strange error ERROR Error: NodeInjector: NOT_FOUND [NgControl] Continue reading...