0.0.1 • Published 6 months ago

srs-input-control v0.0.1

Weekly downloads
-
License
-
Repository
-
Last release
6 months ago

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.

1. reset

Actions to use function reset()

2. enable

Actions to use function enable()

3. disable

Actions to use function disable()

4. setValidators

Actions to use function setValidators(arg5)

5. clearValidatorControl

Actions to use function clearValidatorControl()

6. markAsTouched

Actions to use function markAsTouched()

7. markAsUntouched

Actions to use function markAsUntouched()

8. markAsDirty

Actions to use function markAsDirty()

9. markAsPristine

Actions to use function markAsPristine()