Closed daniele-pecora closed 2 years ago
The current implemented check of an empty object doesn't recognize an empty object that inherits from prototype.
This seems to being added with commit https://github.com/guillotinaweb/ngx-schema-form/pull/415/commits/ccb841a7866ca77486e4293418a3f8b6e5834787
Since ...
var a={} var valid = a !== {}
... valid will be true here, so this can't be used as comparison for an empty object.
true
Instead the properties must be checked explicit for existence.
eg.
var a={} var valid = (value)=>{ for(var i in value) return false; return true; }
The current implemented check of an empty object doesn't recognize an empty object that inherits from prototype.
This seems to being added with commit https://github.com/guillotinaweb/ngx-schema-form/pull/415/commits/ccb841a7866ca77486e4293418a3f8b6e5834787
Since ...
... valid will be
true
here, so this can't be used as comparison for an empty object.Instead the properties must be checked explicit for existence.
eg.