import { Component, OnInit, Injectable } from '@angular/core'; import { DropZoneResp } from '../../models/dropzone'; import { ServiceApi } from '../../services/serviceApi'; import { ServiceComm } from '../../services/serviceComm'; @Component({ selector: 'app-list-of-dzs', templateUrl: './list-of-dzs.component.html', styleUrls: ['./list-of-dzs.component.css'] }) export class ListOfDzsComponent implements OnInit { public listOfDropZones: Array = new Array(); constructor(private serviceApi: ServiceApi, private serviceComm: ServiceComm) { } ngOnInit() { this.serviceComm.updatedComponentTitle('List of DZs'); this.getListOfDropZones(); } getListOfDropZones() { this.serviceApi.getListOfDropZones() .subscribe(data => this.listOfDropZones = data); } }