LoginSignup
0
1

More than 5 years have passed since last update.

angular2-materializeでdatepickerのeventを受け取る

Posted at

情報が少なすぎて困るので共有&メモ

inputのeventを動的に受け取りたい

送信ボタンや決定ボタンのようなコンポーネントがUIに無かったので、pickerのonClose()をハンドリングしたかった

※本当はdone的なeventが良かったのだけれど、そもそも存在しないぽい
https://materializecss.com/pickers.html

結果的に以下でおk

コード

.html
<input id="date" name="date" [(ngModel)]="date"
        materialize="pickadate" [materializeParams]="datepickerformat"
        type="text" placeholder="全て"/>
.ts
  date= '';        // 選択日付
  datepickerformat = [{    // datepickerフォーマット
   //〜中略〜
    onClose: (el) => {
      console.log('datepicker close', el);
    }
  }];
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1