import { Component , OnInit } from '@angular/core' ; import { CustomerDetail } from 'src/app/models/customer/customerDetial' ; import { CustomerService } from 'src/app/services/customer/customer.service' ; @ Component ( { selector : 'app-customer' , templateUrl : './customer.component.html' , styleUrls : [ './customer.component.css' ] , } ) export class CustomerComponent implements OnInit { customers : CustomerDetail [ ] ; dataLoaded = false ; constructor ( private customerService ) { } ngOnInit ( ) { this . getCustomer ( ) ; } getCustomer ( ) { this . customerService . getCustomer ( ) . subscribe ( ( response ) => { this . customers = response . data ; this . dataLoaded = true ; } ) ; } }