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
It would be possible to do by declaring a toJSON() method in the class, if present it gets called from JSON.stringify(). However, @model overrides toJSON() on the class prototype. I could make it that if toJSON is already declared it wont get overridden (with a warning).
Because I want to specify a class that behave like a type.
For example:
will be serialized this way:
{counter: { [key: string]: number; }}
but I would like it to be this way directly:
{ [key: string]: number; }
I'm currently declaring:
type MyCounterType = { [key: string]: number; }
with the drawback that a type doesn't have methods and I have to create another class for this:
The text was updated successfully, but these errors were encountered: