Eduard Arevshatyan Eduard Arevshatyan - 1 year ago 112
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
tag i have parse data from server, and i dont know how bind
tag with this

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 Source

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

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

Plunker example

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download