Guest User

Untitled

a guest
Apr 20th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. @Component({
  2. template: `<p>{{data}}</p>`
  3. })
  4. export class SomeComponent implements OnInit {
  5.  
  6. data: any;
  7.  
  8. constructor(protected dataService: DataService) {}
  9.  
  10. ngOnInit() {
  11. this.dataService.getData().subscribe((result) => {
  12. this.data = result;
  13. }, (error) => {});
  14. }
  15.  
  16. }
Add Comment
Please, Sign In to add comment