Angular Material mat-datepicker (change) event and format

后端 未结 5 2121
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-18 20:42

I am using angular material datepicker directive and I have few problems.

1. When I open date picker dialog and select any date, date shows up in i

5条回答
  •  悲哀的现实
    2020-12-18 21:10

    I am working in Angular 7 and implementation is as follows.

    Declare an event in your class:

    @Output() 
    dateChange:EventEmitter< MatDatepickerInputEvent< any>>;
    

    Remember you should have the material module already installed. Create one method in typescript file as follows.

    someMethodName(date: any) {  
        // your code here
    }
    

    Your html file matInput will be:

    
    

提交回复
热议问题