ng-custom-checkbox-values
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

angular-custom-checkbox-values

Custom checkbox values like strings or numbers other than default boolean

Install

$ npm i ng-custom-checkbox-values

Usage

Presently works with angular reactive form components only.

Add CustomCheckboxValuesDirective to NgModule

 
import { CustomCheckboxValuesDirective } from "ng-custom-checkbox-values";
 
@NgModule({
    declarations: [
        CustomCheckboxValuesDirective,
        ...
    ]
    ...
}
 

Provide checkedValue, uncheckedValue, indeterminateValue with formControl to checkbox field

<input type="checkbox" checkedValue="Y" uncheckedValue="N" indeterminateValue="I" [formControl]="status"/>
 

OR

<input type="checkbox" [checkedValue]="checkVal" [uncheckedValue]="unCheckVal" [indeterminateValue]="indetermVal" [formControl]="status"/>
 

Author

DarshanKumar L Sagar

Package Sidebar

Install

npm i ng-custom-checkbox-values

Weekly Downloads

2

Version

1.0.5

License

MIT

Unpacked Size

88 kB

Total Files

29

Last publish

Collaborators

  • darshanlsagar