I'm using ionic2, I implemented a class:
import {EventEmitter, Injectable} from 'angular2/core';
@Injectable()
export class LocalPushClear extends EventEmitter<number> {
constructor() {
super();
}
}
The class is used by on of my components to connect cordova plugin event to another component which subscribe to LocalPushClear
, I listen to clear
events, ones it fires, I emit using LocalPushClear
and some other component subscribes:
this._LocalPushClear.subscribe(data => {
// Some action is taken here
});
The thing is that, I was expecting automatic change detection
to be executed upon subscription callback execution(when its done), but it seems like there is no change detection execution at all, I have to do something like click
a button or wrap my Some action with zone.run
, I'm not sure if its a valid behavior or maybe I'm doing something wrong.
Edit: I traces the code and it leads to Subject, so its basically custom event emitter that angular NgZone don't know about(at least I think), but I'm sure, if anyone could confirm, maybe future explain I will be very thankful.