Skip to content

Instantly share code, notes, and snippets.

@gioragutt
Created April 4, 2020 17:16
Show Gist options
  • Save gioragutt/ce4975d6ecdb361caf01b9fa02731165 to your computer and use it in GitHub Desktop.
Save gioragutt/ce4975d6ecdb361caf01b9fa02731165 to your computer and use it in GitHub Desktop.
Examples discussion
class Component {
data$ = this.service.getData();
constructor(private service: Service) { }
}
class Component {
data$: Observable<Data>;
constructor(private service: Service) {
this.data$ = service.getData();
}
}
class Component implements OnInit {
data$: Observable<Data>;
constructor(private service: Service) {}
ngOnInit() {
this.data$ = service.getData();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment