Angular material Datepicker get value on change

后端 未结 3 917
闹比i
闹比i 2021-02-07 04:00

I\'m using the new version of angular and angular material. I need to get the value of the datepicker at the moment the user change the date to then pass that value

3条回答
  •  没有蜡笔的小新
    2021-02-07 04:53

    Sorry I didn't post the answer before, but I solved the problem with the @AJT_82's comment. Here is the code:

    Component HTML

      
        
        
        
      
    

    compoment ts

      public onDate(event): void {
        this.roomsFilter.date = event;
        this.getData(this.roomsFilter.date);
      }
    

    Basically, I just passed the $event of the datepicker to get the value.

提交回复
热议问题