Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
utils
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
EIT-SWE
ux
utils
Commits
982aa95c
Commit
982aa95c
authored
Jun 16, 2020
by
Ryan Diehl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(form): support ivy in DisableControlDirective
parent
ced5f7c0
Pipeline
#106155
passed with stages
in 6 minutes and 29 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
libs/utils/form/src/lib/disable-control/disable-control.directive.ts
...form/src/lib/disable-control/disable-control.directive.ts
+10
-6
No files found.
libs/utils/form/src/lib/disable-control/disable-control.directive.ts
View file @
982aa95c
import
{
Directive
,
Input
}
from
'
@angular/core
'
;
import
{
Directive
,
Input
,
OnChanges
,
Self
,
SimpleChanges
}
from
'
@angular/core
'
;
import
{
NgControl
}
from
'
@angular/forms
'
;
import
{
NgControl
}
from
'
@angular/forms
'
;
@
Directive
({
@
Directive
({
selector
:
'
[utDisableControl]
'
selector
:
'
[utDisableControl]
'
})
})
export
class
DisableControlDirective
{
export
class
DisableControlDirective
implements
OnChanges
{
constructor
(
private
ngControl
:
NgControl
)
{}
constructor
(
@
Self
()
private
ngControl
:
NgControl
)
{}
@
Input
(
'
utDisableControl
'
)
@
Input
(
'
utDisableControl
'
)
public
set
disableControl
(
condition
:
boolean
)
{
public
disableControl
:
boolean
;
const
action
=
!!
condition
?
'
disable
'
:
'
enable
'
;
this
.
ngControl
.
control
[
action
]();
public
ngOnChanges
(
changes
:
SimpleChanges
):
void
{
if
(
changes
&&
changes
[
'
disableControl
'
])
{
const
action
=
!!
this
.
disableControl
?
'
disable
'
:
'
enable
'
;
this
.
ngControl
.
control
[
action
]();
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment