X Tutup
Skip to content

Bug: must mention the directive name when only binding to one of its outputs #5707

@wardbell

Description

@wardbell

Detected in alpha 42..48. @vsavkin thinks it might be fixed coincidentally in a.49.

Recording the report here so we can track and confirm.

Report

The following works

<div my-click (my-click)="clicks=$event">click me</div>

but this doesn't (the directive is never instantiated)

<div (my-click)="clicks=$event">click me</div>

for directive:

@Directive({selector:'[my-click]'})
export class MyClickDirective {
  @Output() myClick = new EventEmitter<string>();
  constructor(el: ElementRef){
    el.nativeElement
      .addEventListener('click', (event:Event) => {
        this.myClick.emit('Click!');
      });
  }
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    X Tutup