export class PageOneComponent {
subscription: Subscription;
constructor(private demoQuery: DemoQuery) {}
ngOnInit() {
this.subscription = this.demoQuery.selectSomeProp$.subscribe(prop => {
this.someMethod();
});
}
someMethod() {}
}
@Component({
template: `<button (click)="update()">Update prop</button>`
})
export class PageTwoComponent {
constructor(private demoService: DemoService) {}
update() {
this.demoService.updateKey();
}
}