diff options
author | 2020-02-19 06:02:26 +0000 | |
---|---|---|
committer | 2020-02-19 06:21:39 +0000 | |
commit | 8b413dccc18d361ac78e0d9f49e1dd761a79a258 (patch) | |
tree | e8a47090a1643a73be4027b2dd5c69f135aced8c /usecaseui-portal/src/app/Directives/disable-control.directive.ts | |
parent | 7343c79b3fbba637700e92e06f09b39a9707131f (diff) |
Changes for MDONS usecase
Added MDONS creation and Detail show pages and logic
Change-Id: If830fc0399af561e712b8deff745c8bd88e8117d
Issue-ID: USECASEUI-371
Signed-off-by: root <preethamshyam.sathiyaseelan@us.fujitsu.com>
Diffstat (limited to 'usecaseui-portal/src/app/Directives/disable-control.directive.ts')
-rw-r--r-- | usecaseui-portal/src/app/Directives/disable-control.directive.ts | 17 |
1 files changed, 17 insertions, 0 deletions
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 |