Skip to content

Commit 2a209ef

Browse files
authored
Create table.component.ts
1 parent 71da24b commit 2a209ef

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

table.component.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// table.component.ts
2+
import { Component, OnInit } from '@angular/core';
3+
4+
import { OrderTable } from './order-table.model';
5+
import { OrderService } from './order.service';
6+
7+
@Component({
8+
selector: 'app-order-table',
9+
templateUrl: './order-table.component.html',
10+
styleUrls: ['./order-table.component.css']
11+
})
12+
export class OrderTableComponent implements OnInit {
13+
orderTable: OrderTable;
14+
productHeader = 'Product';
15+
headers: string[];
16+
17+
constructor(private orderService: OrderService) { }
18+
19+
ngOnInit() {
20+
this.orderTable = this.orderService.getOrderTable();
21+
this.headers = [this.productHeader].concat(this.orderTable.headers);
22+
}
23+
24+
}

0 commit comments

Comments
 (0)