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
This is quite angular specific, but whenever you bind a getter to angular, it looks like that if it isn't binded in autoserialize it won't work.
Example:
@autoserialize public Quantity: number;
public set _Quantity(value: number) {
this.QuantitySpecified = true;
this.Quantity= value;
}
public get _Quantity(): number {
return this.Quantity;
}
@autoserialize public QuantitySpecified: boolean;
By binding _Quantity to the angular's NgModel (or anything similar, really), this won't work if the instance is coming from a Deserialization.
To make it work, you need to bind the setter with serialize / deserialize / autoserialize.
So, to make it work, you need to do:
@autoserialize public Quantity: number;
@autoserialize public set _Quantity(value: number) {
this.QuantitySpecified = true;
this.Quantity= value;
}
public get _Quantity(): number {
return this.Quantity;
}
@autoserialize public QuantitySpecified: boolean;
Not really relevant with the package itself, but it's worth mentioning that it's always better to serialize the setter.
The text was updated successfully, but these errors were encountered:
This is quite angular specific, but whenever you bind a getter to angular, it looks like that if it isn't binded in
autoserialize
it won't work.Example:
By binding
_Quantity
to the angular's NgModel (or anything similar, really), this won't work if the instance is coming from a Deserialization.To make it work, you need to bind the setter with serialize / deserialize / autoserialize.
So, to make it work, you need to do:
Not really relevant with the package itself, but it's worth mentioning that it's always better to serialize the setter.
The text was updated successfully, but these errors were encountered: