npm @ngx-formly/bootstrap 5.10.0
v5.10.0

latest releases: 5.11.2, 6.0.0-next.9, 5.11.1...
4 years ago

Highlights

  • lazy render hidden fields: When enabled the components of hidden fields will not be present on the DOM which improves the rendering performance and avoid extra HTTP calls when used with the async pipe.

To enable this feature pass true to lazyRender options:

    FormlyModule.forRoot({
+      extras: {
+        lazyRender: true,
+      },
    }),
  • reset field on hide: By default Formly model contains the value of hidden fields which is not convenient in some cases so we've introduced a new option resetFieldOnHide that detach the hidden field value from the main model.

To enable this feature pass true to resetFieldOnHide options:

    FormlyModule.forRoot({
+      extras: {
+        resetFieldOnHide: true,
+      },
    }),
  • allow passing multiple errors from a single validator: To validate multiple fields with a single validator which is useful in dealing with server-side validation for an entire form section and display distinct error messages for each field.
export function customValidator() {
  ...

  return {
    passwordValidator: {
      errorPath: 'password',
      message: 'Please choose a stronger password!', 
    },
    usernameValidator: {
      errorPath: 'username',
      message: 'This username is already taken!',
    },
  };
}

Bug Fixes

  • core: avoid memory leakes for internal componentRefs (#2474) (e3d29e5), closes #2449
  • core: share formControl for array field when key is duplicated (#2422) (8e461f4), closes #2420
  • json-schema: avoid rely on default value for select oneOf item (#2431) (1c182bf), closes #2429
  • json-schema: avoid reset on hide during the build step (#2426) (07fb1f6), closes #2420
  • json-schema: support nested oneOf (#2428) (085f32c), closes #2403
  • json-schema: take account of passing float to multipleOf validation (#2441) (f0ba4be), closes #2435
  • material: apply a11y for validation messages (#2464) (c35a73b)
  • material: remove empty mat-prefix and mat-suffix (#2444) (108fe95), closes #2443
  • schematics: update angular-devkit deps (#2413) (6e232e1)

Features

Don't miss a new bootstrap release

NewReleases is sending notifications on new releases.