4

I am using [disabled]="true" for disable datepicker,

app.component.html:

<div>
  <angular2-date-picker [(ngModel)]="date" [settings]="settings" [disabled]="true"></angular2-date-picker>
</div

app.component.ts:

import { Component, OnInit } from '@angular/core';
@Component({    
  selector: 'app-root',  
  templateUrl: './app.component.html',  
  styleUrls: ['./app.component.css'] 
})

export class AppComponent {
  date: Date = new Date(); 
  settings = {
    bigBanner: false,
    timePicker: false,    
    format: 'dd-MM-yyyy',    
    defaultOpen: false,    
    disabled: true    
  }
}

1 Answer 1

3

Try pointer-events

The pointer-events CSS property sets under what circumstances (if any) a particular graphic element can become the target of mouse events

  <angular2-date-picker [(ngModel)]="date" [settings]="settings" 
  [ngStyle]="{'pointer-events': true ? 'none' : 'auto' }" >
  </angular2-date-picker>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.