Skip to content

Commit

Permalink
Merge pull request #108 from erqk/v5
Browse files Browse the repository at this point in the history
V5
  • Loading branch information
erqk authored Mar 5, 2024
2 parents 4dee7c7 + ab96f38 commit d4aa212
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change log

## 5.2.11

### Chore

- Write value into control even it's null or undefined.

## 5.2.10

### Fix
Expand Down
2 changes: 1 addition & 1 deletion projects/ng-dynamic-json-form/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ng-dynamic-json-form",
"version": "5.2.10",
"version": "5.2.11",
"author": {
"name": "erqk",
"url": "https://github.com/erqk"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
ComponentRef,
DestroyRef,
HostBinding,
Injector,
Input,
SimpleChanges,
TemplateRef,
Expand Down Expand Up @@ -60,7 +59,6 @@ import { ErrorMessageComponent } from '../error-message/error-message.component'
})
export class FormControlComponent implements ControlValueAccessor, Validator {
private _cd = inject(ChangeDetectorRef);
private _injector = inject(Injector);
private _destroyRef = inject(DestroyRef);
private _configMappingService = inject(ConfigMappingService);
private _optionsDataService = inject(OptionsDataService);
Expand Down Expand Up @@ -199,17 +197,10 @@ export class FormControlComponent implements ControlValueAccessor, Validator {
this._controlComponentRef = componentRef.instance;

if (!this.data?.readonly) {
const emptyValue =
this._pendingValue === '' ||
this._pendingValue === null ||
this._pendingValue === undefined;

componentRef.instance.registerOnChange(this._onChange);
componentRef.instance.registerOnTouched(this._onTouched);

if (!emptyValue) {
this._onChange(this._pendingValue);
}

this._onChange(this._pendingValue);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/assets/docs/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 5.2.10
## 5.2.11

- [English](./v5/index_en.md)
- [繁中](./v5/index_zh-TW.md)
Expand Down

0 comments on commit d4aa212

Please sign in to comment.