3

i am using a ng-pick-datetime component (https://www.npmjs.com/package/ng-pick-datetime) which looks like this :

<input id="{{name}}"
       name="{{name}}"
       class="form-control"
       [(ngModel)]="value"
       [ngModelOptions]="{ updateOn: 'blur' }"
       [owlDateTimeTrigger]="dt"
       [owlDateTime]="dt"
       (dateTimeChange)="checkDateTime($event)"
       [required]="required"
       [min]="minDateTime"
       [max]="maxDateTime"
       [disabled]="disabled">
<i *ngIf="!options.hiddenIcon" class="far fa-calendar-alt form-control-feedback"></i>
<owl-date-time #dt [pickerType]="options.type" [firstDayOfWeek]="options.firstDayOfWeek" [disabled]="disabled"></owl-date-time>

This component is used in a form as follow:

  <my-date-picker id="date" name="date" [(ngModel)]="action.date" [options]="{type:'both'}" [disabled]="actionDisabled"></my-date-picker>

The issue i have is that when the actionDisabled boolean is true, the text looks like it's disable but the field itself is still editable. I couldn't find anything about issue with dynamic disabled and owl-date-time on the net. Any idea about this ?

PS: I'm working with angular 6, TypeScript/HTML/SCSS components.

Thank's a lot !

Anto
  • 125
  • 8

0 Answers0