In Angular 2 what is the difference between Event Emitter and Subject for announcing an event? It seems like event emitters are less complicated to declare....Which way is p
There is not much difference. EventEmitter
extends Subject
.
The Angular2 team stressed the fact though, that EventEmitter
should not be used for anything else then @Output()
s in components and directives.
The Angular team has stated that they may change the underlying implementation of EventEmitter
and break user code that uses EventEmitter
for something it wasn't intended for. That's the main difference.