If I use only "fomrControlName" without [ngModelOptions], There is no error on page. But it does not register data on my DB.
If I use only [ngModelOptions] without "fomrControlName", It does register data on my DB, but validation area (which I must use) is not working.
<div class="col"> <label class="form-label">{{ '::Title' | abpLocalization }} *</label> <p-calendar [ngModel]="xxxInsert.bbb.ccc| date:'dd/MM/yyyy'" [ngModelOptions]="{ standalone: true }" formControlName="airworthinessEndDate" dateFormat="dd/mm/yy" (ngModelChange)="xxxInsert.bbb.ccc=$event" [showIcon]="true" inputId="icon" [style]="{'width': '100%'}" type="text"></p-calendar><br /> </div>
Actual error message in browser console:
Can't bind to 'ngModelOptions' since it isn't a known property of 'p-calendar'.
- If 'p-calendar' is an Angular component and it has 'ngModelOptions' input, then verify that it is part of this module.
- If 'p-calendar' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
- To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.
imported by the AppModule:
import { FormsModule } from '@angular/forms'; import { CalendarModule } from 'primeng/calendar';