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
I propose the addition of optional formatting of values based on the serialization strategy that was used.
Example:
In model:
@prop(...)
public firstName: string;
@prop({
...
serializable: ['short', 'full'],
//some formatting logic based on serialization
})
public lastName: string;
Thanks for the proposal. Do you have a use case for this? I'm not sure if that's a good practice to have getters with "unexpected" results. For what you describe I would suggest implementing your own getter for a specific field, adding "transform field" function or simply having 2 fields.
A simple use case would be if we wanted to format the data based on certain permissions.
Let's say, for example, 2 types of people can access a list of objects "person" with the property lastName. One type is "supervisor", the other type is "user".
The supervisor should be able to see the full lastName - so they can perform supervision efficiently, while user should only be able to see the first letter, to prevent them from looking up the "person" in question.
I propose the addition of optional formatting of values based on the serialization strategy that was used.
Example:
In model:
Usage:
The text was updated successfully, but these errors were encountered: