'Formly, primeng not able to set value of mindate(datepicker) in component using angular
I am using angular formly and primeng. I have FormlyFieldCalendar and AppComponent in place. Setting the property of minDate in and initialiting the value in FormlyFieldCalendar with minDate works fine, but when i am trying to set the minDate in AppComponent field its not working. Please find below both the scenarios, i have built the sample on StackBlitz for demonstration with link : https://stackblitz.com/edit/ngx-formly-ui-primeng-d7v5g4-nu6ctj?file=app/formly-field-primeng-calendar.ts
Scenario 1: (Works fine)
Scenario 2: (Not working)
I now tried removing the code of setting minDate in FormlyFieldCalendar instead trying to set in Appcomponent by 2 ways.
- By assigning in templateOptions.
- By using datePickerOptions provided in formly.dev webpage but seems doesnt work with primeng.
Solution 1:[1]
While assiging minDate in FormlyFieldCalendar Component we need to make sure we use alias to. It is an alias for field.templateOptions
- -[minDate] ="minDate"
- +[minDate] ="to.minDate"
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Shashank S Chandel |


