Guest User

Untitled

a guest
Jun 17th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. import {Component, OnInit} from '@angular/core';
  2. import {Api, IApi} from '../models/api';
  3. import {ApiService} from '../api.service';
  4.  
  5. @Component({
  6. selector: 'app-list',
  7. templateUrl: './list.component.html',
  8. styleUrls: ['./list.component.css']
  9. })
  10. export class ListComponent implements OnInit {
  11. dataList: Array<IApi> = [];
  12.  
  13. constructor(private empSvc: ApiService) {
  14. }
  15.  
  16. ngOnInit() {
  17. this.empSvc.getData().subscribe(rslt => this.dataList = rslt, error => console.log(error));
  18. }
  19. }
Add Comment
Please, Sign In to add comment