Skip to content
This repository has been archived by the owner on Aug 25, 2022. It is now read-only.

itigoore01/ngx-type-safe-reactive-form

Repository files navigation

Build Status npm version License: MIT

NgxTypeSafeReactiveForm

Installation

npm install --save ngx-type-safe-reactive-form

Usage

Same as the original Reactive Forms, but it has a type.
See https://angular.io/guide/reactive-forms

import { TypeSafeFormBuilder } from 'ngx-type-safe-reactive-form';

@Component({
  selector: 'app-form',
  templateUrl: './form.component.html',
})
export class FormComponent {

  readonly form = this.formBuilder.group({
    username: '',
    password: '',
    rememberMe: false,
  });

  constructor(
    private formBuilder: TypeSafeFormBuilder
  ) { }

}

Live example