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
The current Angular wrapper generator (labs/gen-wrapper-angular) cannot get complex types for @Input properties. There is an easy fix for this:
Current:
${Array.from(reactiveProperties.entries()).map(([propertyName,property])=>javascript`
@Input()
set ${propertyName}(v: ${property.type?.text??'any'}) {
this._ngZone.runOutsideAngular(() => (this._el.${propertyName}=v));}
Proposed:
${Array.from(reactiveProperties.entries()).map(([propertyName,property])=>javascript`
@Input()
set ${propertyName}(v: ${name}Element[${propertyName}]) {
this._ngZone.runOutsideAngular(() => (this._el.${propertyName}=v));}
Notice the change: ${name}Element[${propertyName}]
Something similar can be done for events as well. But in this issue I think we can simply fix the Input properties because events could change substantially: Declarative event emitters #3277.
Alternatives and Workarounds
Currently we maintain our own wrapper generation code in-house.
The text was updated successfully, but these errors were encountered:
irfanullahjan
changed the title
Improved @Input types for Angular wrappers
[labs/gen-wrapper-angular] Improved @Input types for Angular wrappers
Sep 6, 2024
Should this be an RFC?
Which package is this a feature request for?
Other/unknown (please mention in description)
Description
The current Angular wrapper generator (
labs/gen-wrapper-angular
) cannot get complex types for@Input
properties. There is an easy fix for this:Current:
Proposed:
Notice the change:
${name}Element[${propertyName}]
Something similar can be done for events as well. But in this issue I think we can simply fix the Input properties because events could change substantially: Declarative event emitters #3277.
Alternatives and Workarounds
Currently we maintain our own wrapper generation code in-house.
The text was updated successfully, but these errors were encountered: