Issue
The [(ngModel)] is not setting default value for date picker. I have tried various different ways to populate the date picker but have been unable to.
My HTML
<input id="START_DATE" type="datetime-local" [(ngModel)]="startDate"/>
In that example the binding works but I am unable to set the default value.
I can set the value if i just interpolate the value but then i lose my 2 way binding. value="{{startDate}}"
Solution
Plunker - https://plnkr.co/edit/s5OMg2olU2yHI246nJOG?p=preview
<input type="date" [ngModel] ="dt | date:'yyyy-MM-dd'" (ngModelChange)="dt = $event">
Answered By - Younis Ar M
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.