Skip to content

Releases: xtreamsrl/ngx-validation-errors

v2.1.1

27 Nov 22:57
Compare
Choose a tag to compare

2.1.1 (2020-11-27)

Bug Fixes

  • handle empty errors object (399cb42)

v2.0.0

05 Jul 09:45
Compare
Choose a tag to compare

Bug Fixes

  • update pipe creation and usage (ad000db)

chore

  • update readme and package.json (8adbfab)

Features

  • update project to angular 9 (f1b6410)

BREAKING CHANGES

  • complete update to angular 9

Release 1.0.0

12 Jan 22:47
Compare
Choose a tag to compare

Features

  • update to angular 8
  • add structural directive for controlled errors management

Breaking Changes

The 1.0.0 version is compatible with angular 8.

The components have been renamed according to the angular conventions, now they starts with the library prefix.
Update this

<form [formGroup]="heroForm" validationContext="USER.REGISTRATION">
  <div formFieldContainer>
    <label>Name</label>
    <input formControlName="name"/>
  </div>
</form>

changing the name to ngxValidationErrorsField

<form [formGroup]="heroForm" validationContext="USER.REGISTRATION">
  <div ngxValidationErrorsField>
    <label>Name</label>
    <input formControlName="name"/>
  </div>
</form>

The old names are still available but consider it deprecated!

Release 0.4.0

12 Jan 22:48
Compare
Choose a tag to compare

Features

  • add structural directive for controlled errors management
  • add standard names for components

Release 0.3.0

02 Dec 23:48
Compare
Choose a tag to compare

0.3.0 (2019-11-19)

Breaking Changes

The 0.3.0 version removes the dependency from @ngx-translate/core to allow using the library
also without this @ngx-translate or with this or other similar libraries

To update you need to modify the app.module.ts like this:

import {MESSAGES_PIPE_FACTORY_TOKEN, MESSAGES_PROVIDER, NgxValidationErrorsModule} from '@xtream/ngx-validation-errors'; 

export function translatePipeFactoryCreator(translateService: TranslateService) {
  return (detector: ChangeDetectorRef) => new TranslatePipe(translateService, detector);
}

@NgModule({
  providers: [
    {
     provide: MESSAGES_PIPE_FACTORY_TOKEN,
     useFactory: translatePipeFactoryCreator,
     deps: [TranslateService]
    },
    {
     provide: MESSAGES_PROVIDER,
     useExisting: TranslateService
    }
  ]
})

The function returns a factory that is used by the library to create a pipe and pass a ChangeDetectorRef instance so on lang change
(or similar event) the components can be updated accordingly.

If you want to use a custom error mapping without translation you can provide your custom pipe and message provider (that exposes an instant(key:string):string method)
like this:

import {MESSAGES_PIPE_FACTORY_TOKEN, MESSAGES_PROVIDER, NgxValidationErrorsModule} from '@xtream/ngx-validation-errors';

export function simpleCustomPipeFactoryCreator(messageProvider: SimpleMessagesProviderService) {
  return (detector: ChangeDetectorRef) => new SimpleErrorPipe(messageProvider, detector);
}

@NgModule({
  providers: [
    {
      provide: MESSAGES_PIPE_FACTORY_TOKEN,
      useFactory: simpleCustomPipeFactoryCreator,
      deps: [SimpleMessagesProviderService]
    },
    {
      provide: MESSAGES_PROVIDER,
      useExisting: SimpleMessagesProviderService
    }
  ]
})

Features

Release 0.2.0

19 Nov 12:36
Compare
Choose a tag to compare

0.2.0 (2019-11-19)

Features

  • add imperative validation clearing

Release 0.1.0

19 Nov 11:38
Compare
Choose a tag to compare

0.1.0 (2019-11-19)

Features

  • array: add array controls validation

Release 0.0.4

04 Nov 11:46
Compare
Choose a tag to compare

0.0.4 (2019-10-31)

Bug Fixes

  • change forRoot method to work with AOT

Release 0.0.3

22 Aug 09:08
Compare
Choose a tag to compare

0.0.3 (2019-08-2)

Bug Fixes

  • change module import for lazy loading error

Release 0.0.2

20 May 23:12
Compare
Choose a tag to compare

0.0.2 (2019-05-20)

Bug Fixes

  • add class is-invalid correclty on error 89fb90e
  • fallback strategy of error messages 3b5a029
  • FormFieldContainer selector in kebab-case 35db7ae