2016-12-07 5 views
1

コンポーネントクラスにdatetime-local入力フィールドの値を設定したいが、その値をバインドできない。datetime-local入力フィールドを埋める

私には何が欠けていますか?ここでは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)); 

は例Plunkerです。

日時 - ローカル入力フィールドが値(クローム55) datetime-local has no value

+0

プランカ。あなたの仕事は何ですか? – anshuVersatile

+1

@anshuVersatileいいえ、** Fill Fiels **ボタンをクリックして、フォームフィールドの日付を入力しません。 –

答えて

1

を持っていない私はあなたがthis.model.dateの文字列形式を使用する必要があると思う、私はあなたのplunkerを変更し、fill fieldsは現在正常に動作します。 https://plnkr.co/edit/FpEBvc?p=preview

+0

フォーマットされた時刻を取得するには、例えば 'moment'を使用します。 – Dimanoid

関連する問題