Eduard Arevshatyan Eduard Arevshatyan - 29 days ago 16
TypeScript Question

Datepicker with imput tag

I would change this lable tag

<label>{{list.createdat | date: 'dd.MM.yyyy'}}</label>
on input tag, to create a simple datapicker:

<input type="date"/>


But in
<label>
tag i have parse data from server, and i dont know how bind
<input>
tag with this
list.createdat


How to write a correct syntax? Like this? :

<input type="date"/ {list.createdat | date: 'dd.MM.yyyy'}>


At finally, i would something like this:

enter image description here

Answer

<input type="date"> requires a string and doesn't work with a Date instance.

<input type="date" [value]="list.createdat">

Plunker example