Skip to content

Instantly share code, notes, and snippets.

@amandeepmittal
Created August 9, 2018 06:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amandeepmittal/2c96c7bb5d56707e878518b02f47971b to your computer and use it in GitHub Desktop.
Save amandeepmittal/2c96c7bb5d56707e878518b02f47971b to your computer and use it in GitHub Desktop.
import { Component, OnInit } from '@angular/core';
import { TableService } from './table.service';
import { Table } from './Table';
@Component({
selector: 'app-table',
templateUrl: './table.component.html',
styles: []
})
export class TableComponent implements OnInit {
employees: Table[];
constructor(private tservice: TableService) {}
ngOnInit() {
this.tservice.getData().subscribe((data: Table[]) => {
this.employees = data;
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment