Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import {Component, OnInit} from '@angular/core';
- import {Api, IApi} from '../models/api';
- import {ApiService} from '../api.service';
- @Component({
- selector: 'app-list',
- templateUrl: './list.component.html',
- styleUrls: ['./list.component.css']
- })
- export class ListComponent implements OnInit {
- dataList: Array<IApi> = [];
- constructor(private empSvc: ApiService) {
- }
- ngOnInit() {
- this.empSvc.getData().subscribe(rslt => this.dataList = rslt, error => console.log(error));
- }
- }
Add Comment
Please, Sign In to add comment