summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/core/Directives/disable-control.directive.ts
diff options
context:
space:
mode:
authorroot <preethamshyam.sathiyaseelan@us.fujitsu.com>2020-02-21 11:34:03 +0000
committerroot <preethamshyam.sathiyaseelan@us.fujitsu.com>2020-02-24 06:24:36 +0000
commit1c0e11d0e8221eedbc86577501d5fd40d4890d7e (patch)
treeb20d544f5a67b60f4ac1babf32c266679649879a /usecaseui-portal/src/app/core/Directives/disable-control.directive.ts
parent324c150c6bc6c81bfc35af23aa865cba2a1fccf4 (diff)
USECASEUI-388 fixed and with additional changes
Fixed i18Resource, subtittle wrap and directive folder Path. Alos added few changes for adapting multiple templates. Change-Id: Ie64485d24d11bcfd59be6c3c119dbccbc6c9b499 Issue-ID: USECASEUI-388 Signed-off-by: root <preethamshyam.sathiyaseelan@us.fujitsu.com>
Diffstat (limited to 'usecaseui-portal/src/app/core/Directives/disable-control.directive.ts')
-rw-r--r--usecaseui-portal/src/app/core/Directives/disable-control.directive.ts17
1 files changed, 17 insertions, 0 deletions
diff --git a/usecaseui-portal/src/app/core/Directives/disable-control.directive.ts b/usecaseui-portal/src/app/core/Directives/disable-control.directive.ts
new file mode 100644
index 00000000..85495401
--- /dev/null
+++ b/usecaseui-portal/src/app/core/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