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
is object a constructable function (ie class type) or just a literal? You shouldn't need to be using new in there for sure. If autoserializeAs is not passed a class type, it will assume you are passing in a custom serializer which is { Deserialize: (instance : YOUR_TYPE, json:any) => any, Serialize: (instance : YOUR_TYPE) => any}
Hi @weichx, thank you for your quick answer and sorry for my late answer.
I might have special requirements here.
See http://plnkr.co/edit/5ed8ZK10CFWtHjLTIpTV?p=info for the patched version (app.component.ts)
See http://plnkr.co/edit/QqrY3aPxOimtol7yfvJW?p=info for the original version (app.component.ts)
(I couldn't reproduce the same effect I have in my project here, nevertheless it also doesn't work here)
I couldn't find any negative side effects of my patched version.
I had to change
TO
in order to maintain object type.
If you skip new here you get an anonymous object.
--- Background
I used @autoserializeAs(MyObject)
but what i got on deserialisation was a anonymous Object without the methods I expected the Object to have (MyObject).
I would appreciate an opinion to this or if i missed something.
Greetings
The text was updated successfully, but these errors were encountered: