Angular 2: How to use JavaScript Date Object with NgModel two way binding

后端 未结 7 1696
醉酒成梦
醉酒成梦 2020-12-02 10:01

I\'m working with Angular 2 and I have this code:

JS, this code initiates the employee-variable for the template:

handleEmployee(employee : Employee)         


        
相关标签:
7条回答
  • 2020-12-02 10:36

    Read pipes and ngModel and my deсision:

    <input type="date" class="form-control" id="myDate" [ngModel]="myDate | date:'y-MM-dd'" (ngModelChange)="myDate = $event" name="birthday">
    
    0 讨论(0)
提交回复
热议问题