Skip to content

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

Closed

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

Activity

  1. kegluneq commented on Sep 29, 2015

    @kegluneq

    This approach makes sense to me, however I do not have the cycles to make it happen currently.

    In addition, the work done on the compiler-integration branch will obsolete any effort put into this now, so I recommend we wait until that has landed to make these sugar-y kind of changes.

  2. removed their assignment
    on Sep 29, 2015
  3. yjbanov commented on Oct 1, 2015

    @yjbanov
    Contributor

    We should also wait until the Event rename is done, and we should postpone the rename till after pre-compilation lands on master.

  4. yjbanov commented on Oct 1, 2015

    @yjbanov
    Contributor

    This is blocked by #3605

  5. changed the title [-][Dart] Transformers handling of Property, Event, HostBinding and HostListener[/-] [+][Dart] Transformers handling of Input, Output, HostBinding and HostListener[/+] on Oct 25, 2015
  6. tejainece commented on Nov 11, 2015

    @tejainece

    Any updates on this?

  7. angular-automatic-lock-bot commented on Sep 8, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  8. locked and limited conversation to collaborators on Sep 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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