I want to set the value of a datetime-local input field in my component class but I cannot bind the value.
What I am missing?
HTML
<input id="date" type="datetime-local" [(ngModel)]="model.date" class="form-control" />
TS
public model: Model = new Model(-1, "old", new Date(2000, 1,1 ));
Here is a example Plunker.
I think you need to use string format for this.model.date
, I changed your plunker and fill fields
now works fine.
https://plnkr.co/edit/FpEBvc?p=preview