We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cerialize version 2.0.1
Here is example code:
class TestNested { @deserializeAs(Number) id: number; } class TestModel { @deserializeAs(Number) id: number; @deserializeAs(TestNested) n: TestNested; } const data1 = {id: 1, n: {id: 2}}; const data2 = {id: 1, n: null}; console.log('Data1', Deserialize(data1, TestModel)); console.log('Data2', Deserialize(data2, TestModel));
Second deserialization is failing with error while first is ok.
MyComponent_Host.ngfactory.js? [sm]:1 ERROR TypeError: Cannot read property 'id' of null at _Deserialize (deserialize.js:124) at _Deserialize (deserialize.js:139) at Deserialize (deserialize.js:159) // ... remaining stack trace
Is there any way to deserialize optional nested field? Or should I write a custom SerializeFn?
SerializeFn
The text was updated successfully, but these errors were encountered:
Fixes weichx#88: Deserializing optional nested fields
f05d214
Merge pull request #89 from prudnikov/mw/v2
5d18ae6
Fixes #88: Deserializing optional nested fields
No branches or pull requests
Cerialize version 2.0.1
Here is example code:
Second deserialization is failing with error while first is ok.
Is there any way to deserialize optional nested field? Or should I write a custom
SerializeFn
?The text was updated successfully, but these errors were encountered: