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.
https://dev.to/danywalls/transform-inputs-properties-in-angular-easy-n7a
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.
3 Comments
Kwa@derpzilla.net · 1 pts · 2y
Shouldn’t the @Input be of type SchedulerEvent[]? I don’t see where to get the transformed data otherwise
magbeat@programming.dev · 2 pts · 2y
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 typeScheduleEvent[]leave the old API be asCourse[]and mark it as deprecated. In the next major version you could then retire the old API.Kwa@derpzilla.net · 1 pts · 2y
I see, thanks
Link@programming.dev · 1 pts · 2y