bootstrap-reactive-form-controls
v1.0.0
Published
This is a bootstrap form controls library for rapid form creation using angular reactive forms
Downloads
3
Maintainers
Readme
FormControls
This library was generated with Angular CLI version 13.1.0. This library helps you to boostrap your form controls creation for reactive forms
Code sample
This is an example of how to use the libray
After npm install just add the FormControlsModule to your app module imports
App component html
<lib-form-input [type]="'number'" formControlName="age"> <lib-form-label [label]="'location'"> <lib-form-input [type]="'text'" formControlName="location"> <lib-form-label [label]="'Comments'"> <lib-form-textarea [row]="5" formControlName="comment">
App Component
import { Component, OnInit } from '@angular/core'; import { FormBuilder, FormGroup } from '@angular/forms';
@Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'] }) export class AppComponent implements OnInit{ inputForm!:FormGroup title = 'custom-formcontrol-library'; constructor(private fb:FormBuilder){}
ngOnInit(): void { this.inputForm = this.fb.group({ name:[], age:[], location: [], comment: [] }) } }