Skip to content

Instantly share code, notes, and snippets.

@cyrilletuzi
Last active April 12, 2018 17:37
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 cyrilletuzi/1d05acb22f202a38f5ef67d54ee54f55 to your computer and use it in GitHub Desktop.
Save cyrilletuzi/1d05acb22f202a38f5ef67d54ee54f55 to your computer and use it in GitHub Desktop.
@Component({
template: `<p>{{data}}</p>`
})
export class SomeComponent implements OnInit {
data: any;
constructor(protected dataService: DataService) {}
ngOnInit() {
this.dataService.getData().subscribe((result) => {
this.data = result;
}, (error) => {});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment