Is there a way in Angular to exclude specific fields before making an http call, similar to the @JsonIgnore
annotation in Java?
For instance:
Given this object:
{id: 1, libelle: 'test', mustIgnore: 'test'}
;
I am looking to have it transformed into: {id: 1, libelle: 'test'}
;
I attempted to use delete object.field
, but I'm seeking a more streamlined approach, possibly through annotating my object.
Managing this manually for each object is challenging, especially when dealing with arrays of objects.
UPDATE :
I want to avoid deleting fields individually for every object. Is there a method to specify which fields should be excluded and have it done automatically whenever there's a different object with varying fields to remove?