this post was submitted on 13 Nov 2023
4 points (75.0% liked)

Angular

252 readers
1 users here now

A community for discussion about angular

Wormhole

[email protected]

Logo base by Angular under CC BY 4.0 with modifications to add a gradient and drop shadow

founded 1 year ago
MODERATORS
 

Great usecase for the transforming @Input properties.

We will have to refactor a huge (and I mean huge) component for a customer in the near future. The consuming teams should not notice any of this. transform could be very useful for this.

all 4 comments
sorted by: hot top controversial new old
[–] [email protected] 1 points 10 months ago (1 children)

Shouldn’t the @Input be of type SchedulerEvent[]? I don’t see where to get the transformed data otherwise

[–] [email protected] 2 points 10 months ago* (last edited 10 months ago) (1 children)

When you are developing a UI library (as we are) we want to support the old API for some time and mark is a deprecated. So one would add a second @Input() of type ScheduleEvent[] leave the old API be as Course[] and mark it as deprecated. In the next major version you could then retire the old API.

[–] [email protected] 1 points 10 months ago

I see, thanks