Skip to content
This repository was archived by the owner on Jan 5, 2022. It is now read-only.

v3.0.0

Choose a tag to compare

@third774 third774 released this 09 Sep 17:13
· 23 commits to master since this release

New Features

Supports Bootstrap 4!

Breaking Changes

  • Requires Angular 6

  • NgBootstrapFormValidationModule.forRoot() now accepts an object with configuration options instead of just an array for custom error messages. Furthermore, it defaults to BootstrapVersion.Four so if you want to continue using it with Bootstrap 3, you'll need to pass in this additional argument. Alternatively, you may also provide the BootstrapVersion value using the BOOTSTRAP_VERSION token.

import {
  NgBootstrapFormValidationModule,
  BootstrapVersion,
  BOOTSTRAP_VERSION
} from 'ng-bootstrap-form-validation';
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';

@NgModule({
  declarations: [AppComponent],
  imports: [
    BrowserModule,
    FormsModule,
    ReactiveFormsModule,
    NgBootstrapFormValidationModule.forRoot({
      bootstrapVersion: BootstrapVersion.Three, // Defaults to Four
      customErrorMessages: []
    })
  ],
  providers: [
    // Alternatively, you can provide the BootstrapVersion value
    // using the BOOTSTRAP_VERSION token
    // {
    //   provide: BOOTSTRAP_VERSION,
    //   useValue: BootstrapVersion.Three
    // }
  ],
  bootstrap: [AppComponent]
})
export class AppModule {}

Other Bug Fixes

  • Radio button validation fixed - #32
  • Validation for array fields - #40
  • Error when using inputs styled as form-control outside of forms #46