Skip to content

Instantly share code, notes, and snippets.

@cyrilletuzi

cyrilletuzi/component.ts

Last active Apr 12, 2018
Embed
What would you like to do?
@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