You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
REASON to ask:
I am implementing custom angular file-select component and want File object to be accessible as formfield value on formSubmit. But when I do valueChanges.emit({file: someFileObjWithBlob}) inside custom element then on submit event I get empty object (btw customEvent transfer File obj correctly)
After small ivestigation I suspect that maybe it is because in submit event handler we sometimes do copy with fastCloneDeep Util function which is just JSON.parse(JSON.stringify(obj))
So maybe it make sense to replace it with structuredClone?
structuredClone does File structure copy correctly.
What do you think?
The text was updated successfully, but these errors were encountered:
Hi
REASON to ask:
I am implementing custom angular file-select component and want File object to be accessible as formfield value on formSubmit. But when I do valueChanges.emit({file: someFileObjWithBlob}) inside custom element then on submit event I get empty object (btw customEvent transfer File obj correctly)
After small ivestigation I suspect that maybe it is because in submit event handler we sometimes do copy with fastCloneDeep Util function which is just JSON.parse(JSON.stringify(obj))
So maybe it make sense to replace it with structuredClone?
structuredClone does File structure copy correctly.
What do you think?
The text was updated successfully, but these errors were encountered: