Can I use transform
to have an @Input or InputSignal receive an array and transform it to an object containing the array?
Example:
<my-component
[array]="myArray"
/>
export class MyComponent {
public readonly array = input<number[]>([], {
transform: transformArrayToObject,
});
So if the value passed to array is [1, 2, 3]
, the transformed data will be, by example:
{
array: [1, 2, 3];
status: Status.OK
}