NetanelBasal
9/24/2018 - 8:18 PM

ml-3.ts

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();
  }
}