1

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)

enter image description here

Scenario 2: (Not working)

I now tried removing the code of setting minDate in FormlyFieldCalendar instead trying to set in Appcomponent by 2 ways.

  1. By assigning in templateOptions.
  2. By using datePickerOptions provided in formly.dev webpage but seems doesnt work with primeng.

enter image description here

4

1 回答 1

0

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"
于 2020-09-03T17:38:53.237 回答