SRS-Input-Control
Simple service for your formgroup and formcontrol.
Table of Contents
Installation
$ npm i srs-input-control
Usage
To use SRSInputControlService in your Angular project, import the SRSInputControlService into your component.ts and add it to your function.
import { SRSInputControlService } from 'srs-input-control';
// ...
constructor(private fb: FormBuilder, private srsInputService: SRSInputControlService)
// ...
this.srsInputService.actionControl(arg1, arg2, arg3, arg4, arg5)
// ...
arg1
Action for formControl
arg2
Your formgroup which you want to access formContol
arg3
List of formControl's name that you want to disable
arg4
List of formControl's name that you don't want to disable
arg5
Validators for action setValidators, can null or undefined
For example, to use the reset
function:
// ...
this.srsInputService.actionControl("reset", arg2, arg3, arg4, arg5)
// ...
Available Actions
Every function takes the same parameters.
reset
1. Actions to use function reset()
enable
2. Actions to use function enable()
disable
3. Actions to use function disable()
setValidators
4. Actions to use function setValidators(arg5)
clearValidatorControl
5. Actions to use function clearValidatorControl()
markAsTouched
6. Actions to use function markAsTouched()
markAsUntouched
7. Actions to use function markAsUntouched()
markAsDirty
8. Actions to use function markAsDirty()
markAsPristine
9. Actions to use function markAsPristine()