Here is service:
@Injectable()
export class AuthService {
public reset: Subject<any>;
constructor() {
this.reset = new Subject();
}
public logout() {
this.reset.next('logout');
}
}
This is another service which wants to know when logout() happens:
@Injectable()
export class StoreService() {
constructor(private auth: AuthService) {
this.auth.changes.subscribe((value) => {
// Do not work God knows why
});
}
}
Subscription in the second service will never get any events. Why?