is it possible to emit a custom event on ngOnDestroy ? I tried, but it seems like it does not work... I basically need to know when a Directive is removed from the UI.
@Output() rowInit = new EventEmitter();
@Output() rowDestroy = new EventEmitter();
ngAfterViewInit() {
this.rowInit.emit(this);
}
ngOnDestroy() {
console.log("I get called, but not emit :(, ngAfterViewInit works :)");
this.rowDestroy.emit(this);
}
tableViewOnInitEvent = new EventEmitter();
etc. Is it possible to set those emitters to "subscribe only / read only" ? I don't want to call the emitters directly via the service but I want to call the emitter from a function inside the Service, like this:(Inside Service):public tableViewOnInit(tableView) { this.tableViewOnInitEvent.next({ tableView: tableView }); }
Thanks :) – Pervade