title: Angular ng-pick-datetime - Disable the input based on a condition
body: <p>I'm working on <strong>Angular 8</strong> and I'm using <strong>ng-pick-datetime</strong> plugin. I wish to disable the date time picker as well as the input element that triggers it based on a condition dynamically. I tried to search but couldn't find any solution. Following is my code:-</p>
  
  <pre><code>&lt;input type="text" 
   style="cursor: pointer; border: none; height: 25px; text-align: center; font-size: small; box- 
   shadow: 0 0 0 0 white !important;"
   placeholder="DD MMM YYYY" class="datepicker" 
   id="date" [disabled]="!editable" #date 
   [owlDateTimeTrigger]="date" [owlDateTime]="date" 
   [min]="min" [max]="max"&gt; 
  
  &lt;img alt="" 
    src="./assets/images/datepicker.svg" 
    style="position: relative; top: 6px; margin-right: 5px;" height="20px" width="20px;"&gt;
  
  
  &lt;owl-date-time [disabled]="!editable" [pickerType]="'calendar'" 
    #date&gt;&lt;/owl-date-time&gt;
  </code></pre>
  
  <p>When tried above, a class termed <strong>owl-dt-trigger-disabled</strong> gets attached to my input element. It seems like the input element is disabled, but we can still edit the input element manually.</p>
  
  <p><a href="https://i.stack.imgur.com/a1nEv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/a1nEv.png" alt="enter image description here"></a></p>
  
  <p>Here, when my <strong>'editable'</strong> variable is false, I want to disable the datepicker input. If anyone have an answer, please help me.</p>
  
  <p>I found a question but didn't find any answer-
  <a href="https://stackoverflow.com/questions/52421072/cant-dynamically-disabled-ng-pick-datetime-component">Can't dynamically disabled ng-pick-datetime component</a></p>
  
  <p><strong>Update</strong></p>
  
  <p>Please find the stackblitz link for the same question asked above. I have already set <strong>editable</strong> as false -
  <a href="https://stackblitz.com/edit/angular-ng-pick-datetime?embed=1&amp;file=src/app/app.component.html" rel="nofollow noreferrer">Angular ng-pick-datetime - Disable the input based on a condition</a></p>