From 51bd8c41317646ca09a6e7e56aa97b9cd01a30b0 Mon Sep 17 00:00:00 2001 From: achebrol Date: Sun, 22 Oct 2017 12:12:58 -0700 Subject: [PATCH] Update ng2-datetime.ts So that we dont have to explicitly enable readonly to true when the formcontrol is set to disabled. --- src/ng2-datetime/ng2-datetime.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ng2-datetime/ng2-datetime.ts b/src/ng2-datetime/ng2-datetime.ts index 2769dd9e..e936e4cd 100644 --- a/src/ng2-datetime/ng2-datetime.ts +++ b/src/ng2-datetime/ng2-datetime.ts @@ -141,6 +141,10 @@ export class NKDatetime implements ControlValueAccessor, AfterViewInit, OnDestro this.onTouched = fn; } + setDisabledState( isDisabled : boolean ) : void { + this.readonly = isDisabled; + } + checkEmptyValue(e: any) { const value = e.target.value; if (value === '' && (