Skip to content

Instantly share code, notes, and snippets.

@NetanelBasal
Last active September 24, 2018 20:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NetanelBasal/50813cb131003a68329f9994f08bf3c7 to your computer and use it in GitHub Desktop.
Save NetanelBasal/50813cb131003a68329f9994f08bf3c7 to your computer and use it in GitHub Desktop.
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();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment