Releases: xtreamsrl/ngx-validation-errors
v2.1.1
v2.0.0
Release 1.0.0
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
Features
- add structural directive for controlled errors management
- add standard names for components
Release 0.3.0
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
- remove dependency form @ngx-translate
Release 0.2.0
0.2.0 (2019-11-19)
Features
- add imperative validation clearing
Release 0.1.0
0.1.0 (2019-11-19)
Features
- array: add array controls validation
Release 0.0.4
0.0.4 (2019-10-31)
Bug Fixes
- change forRoot method to work with AOT
Release 0.0.3
0.0.3 (2019-08-2)
Bug Fixes
- change module import for lazy loading error