2021年3月28日星期日

How to make mat-select first option null?

I use 3 mat-select for day-month-year selection as shown on this DEMO.

I need to make the first options as null or undefined and modify that code as shown below:

allDates: number[] = [null];  dates: number[] = [null];  months: number[] = [null];  years: number[] = [null];  

But I am not sure if it is a good idea or is there a proper way for mat-select. I also try to set [value]=null for the mat-select options, but in that case it does not receive the value properly. So, what is a proper way for this?

https://stackoverflow.com/questions/66846927/how-to-make-mat-select-first-option-null March 29, 2021 at 06:48AM

没有评论:

发表评论