From 8b413dccc18d361ac78e0d9f49e1dd761a79a258 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 19 Feb 2020 06:02:26 +0000 Subject: Changes for MDONS usecase Added MDONS creation and Detail show pages and logic Change-Id: If830fc0399af561e712b8deff745c8bd88e8117d Issue-ID: USECASEUI-371 Signed-off-by: root --- .../src/app/Directives/disable-control.directive.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 usecaseui-portal/src/app/Directives/disable-control.directive.ts (limited to 'usecaseui-portal/src/app/Directives') diff --git a/usecaseui-portal/src/app/Directives/disable-control.directive.ts b/usecaseui-portal/src/app/Directives/disable-control.directive.ts new file mode 100644 index 00000000..85495401 --- /dev/null +++ b/usecaseui-portal/src/app/Directives/disable-control.directive.ts @@ -0,0 +1,17 @@ +import { Directive, Input } from '@angular/core'; +import { NgControl } from '@angular/forms'; + +@Directive({ + selector: '[disableControl]' +}) +export class DisableControlDirective { + + @Input() + set disableControl(condition: boolean) { + const action = condition ? 'enable' : 'disable'; + this.ngControl.control[action](); + } + + constructor(private ngControl: NgControl) { + } +} \ No newline at end of file -- cgit 1.2.3-korg