@ng-dynamic-forms/ui-material
Advanced tools
Changelog
10.1.0
Customizing the condition for displaying validation error messages can now be achieved by providing a
DynamicErrorMessagesMatcher
via newly introduced injection token DYNAMIC_ERROR_MESSAGES_MATCHER
:
function myCustomErrorMessagesMatcher (control: AbstractControl, model: DynamicFormControlModel, hasFocus: boolean) {
return //...
};
providers: [
{
provide: DYNAMIC_ERROR_MESSAGES_MATCHER,
useValue: myCustomErrorMessagesMatcher
},
By default the DEFAULT_ERROR_STATE_MATCHER
is active:
export const DEFAULT_ERROR_STATE_MATCHER: DynamicErrorMessagesMatcher =
(control: AbstractControl, model: DynamicFormControlModel, hasFocus: boolean) => {
return control.touched && !hasFocus;
};
Please read the updated chapter on validation messaging
Changelog
10.0.0
ChangeDetectionStrategy.OnPush
under the hood.
Whenever modifying a DynamicFormControlModel
(except for value
and disabled
setters) that means you need to manually
trigger change detection by simply calling detectChanges()
on DynamicFormService
.Please also read the new chapter on updating form controls.
BEFORE:
// Immeditialy triggers UI update
myModel.value = "New Value";
myModel.disabled = true;
myModel.label = "New Label";
AFTER:
// This still works
myModel.value = "New Value";
myModel.disabled = true;
// This doesn't work automatically any more
myModel.label = "New Label";
// You need to manually trigger change detection
this.formService.detectChanges();
findModelById<T>
and findControlByModel<T>
now use a type variable so you don't need to cast its return value any more.DISABLED_MATCHER
has been renamed to DISABLED_MATCHER_PROVIDER
HIDDEN_MATCHER
has been renamed to HIDDEN_MATCHER_PROVIDER
REQUIRED_MATCHER
has been renamed to REQUIRED_MATCHER_PROVIDER
Changelog
9.1.0
A new UI package @ng-dynamic-forms/ui-ngx-bootstrap
has been released. This allows using ngx-bootstrap with Bootstrap 4 now.
Thus the package @ng-dynamic-forms/ui-bootstrap
from now on is only recommended if still need to support Bootstrap 3.correctly
appendTo
input now works in PrimeNG Dropdown and MultiselectdecimalSeparator
, thousandSeparator
, formatInput
and size
inputs now works in PrimeNG SpinnerChangelog
8.0.1
DynamicFormControlContainerComponent
model type css classChangelog
8.0.0
DynamicFormLayout
now supports selecting of form control types and multiple idsDynamicFormControlContainerComponent
templates now render a css class by model typefindControlByModel()
function added to DynamicFormService
findByModel() function added to
DynamicFormLayoutService`relation
property of DynamicFormControlModel
has been renamed to relations
action
property on DynamicFormControlRelation
has been renamed to match
connective
property on DynamicFormControlRelation
has been renamed to operator