X Tutup
Skip to content

[Dart] Transformers handling of Input, Output, HostBinding and HostListener #4407

@vicb

Description

@vicb

As of today the Input, Output, HostBinding and HostListener are added to the propMetadata property of a RegisteredType.

As a result Property does not generate setters and Event does not generate getters.

I think that a best way to handle them would be:

  • to merge the info into the metadata
  • to not record the property decorator on the RegisteredType
@Component({})
class Cmp {
  @Input() pa;
  @Input('pb-name') pb;

  @Output() ea;
  @Output('EventName') eb; 

  @HostBinding('hpa') toHost;

  @HostListener('event', [exp1, exp2]) handleEvent(a1, a2) { ... }
}

// should lead to the same metadata as:

@Component({
  properties: ['pa', 'pb: pb-name'],
  events: ['ea', 'eb: EventName'],
  host: {
    'hpa': 'toHost',
    '(event)': 'handleEvent(exp1, exp2)'  
  }
})
class Cmp {}

/cc @vsavkin

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort2: daysfeatureLabel used to distinguish feature request from other issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup