0
votes

I am trying to run a function when user selects a date range in MatDateRangePicker. https://material.angular.io/components/datepicker/api

Here is the stackblitz https://stackblitz.com/edit/angular-gxbc8x?file=src/app/date-range-picker-overview-example.html

But nothing happens, no event is fired when date range is selected. How can I attach the hello() function when user selects a date range?

1

1 Answers

1
votes

You need to use dateChange as event binding inside input and make condition into your TS file, I have updated the code please have a look -

https://stackblitz.com/edit/mat-date-range-input?file=src%2Fapp%2Fdate-range-picker-overview-example.html