Skip to content
This repository has been archived by the owner on Aug 27, 2024. It is now read-only.

Commit

Permalink
Fix updating schema for an object arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
Dev3124 committed Feb 27, 2023
1 parent e1cf8d9 commit 12a1b69
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
7 changes: 4 additions & 3 deletions dist/all.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/all.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/all.min.js.map

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions dist/test.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/cn-flex-form.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,8 @@ function CNFlexFormService(
!isInitArray &&
val !== null/* &&
!angular.equals(val, service.getDefault(key))*/) {
service.params[key] = val;
// if val is an array that has on object, need deep copy
service.params[key] = angular.copy(val);
}
else {
delete service.params[key];
Expand All @@ -1000,7 +1001,7 @@ function CNFlexFormService(
if(listener) {
var val = service.parseExpression(key, service.model).get();
if(listener.updateSchema && !angular.isUndefined(val) && val !== null) {
service.params[key] = val;
service.params[key] = angular.copy(val);
}
}
});
Expand Down

0 comments on commit 12a1b69

Please sign in to comment.