Suppose I have a controller where I'm emitting an event:
@Output() somethingUpdated = new EventEmitter();
and in a method:
***
this.somethingUpdated.emit();
***
In the view, I've added:
(somethingUpdated)="somethingUpdated($event)"
In a directive, I defined:
@HostListener('somethingUpdated', ['$event'])
somethingUpdated() {
console.log('somethingUpdated');
}
However, this setup doesn't seem to be working.
What am I doing wrong?