summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/Directives
diff options
context:
space:
mode:
authorroot <preethamshyam.sathiyaseelan@us.fujitsu.com>2020-02-19 06:02:26 +0000
committerroot <preethamshyam.sathiyaseelan@us.fujitsu.com>2020-02-19 06:21:39 +0000
commit8b413dccc18d361ac78e0d9f49e1dd761a79a258 (patch)
treee8a47090a1643a73be4027b2dd5c69f135aced8c /usecaseui-portal/src/app/Directives
parent7343c79b3fbba637700e92e06f09b39a9707131f (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')
-rw-r--r--usecaseui-portal/src/app/Directives/disable-control.directive.ts17
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