I have this input
<input type="time" [(ngModel)]="post.time" value="{{selectedTime}}"
formControlName="scheduled-time">
The time looks like this:
--:--:--
How can I make the default is the current time?
I have this input
<input type="time" [(ngModel)]="post.time" value="{{selectedTime}}"
formControlName="scheduled-time">
The time looks like this:
--:--:--
How can I make the default is the current time?
In constructor set post.time to string of the value. i.e 21:37
Here's demo https://stackblitz.com/edit/angular-vk4kyc
Remember that hours and minutes must have 2 digits
You can set the value by assigning value (eg. '15:30') to your ngModel property
For more details: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/time
Also, I don't understand why you have ngModel, formControlName and value being used at the same time. You need only one of these at any time