Issue
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
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"
Answered By - Shashank S Chandel
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.