Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2985456

Browse files
products component added
1 parent bed2059 commit 2985456

File tree

3 files changed

+105
-0
lines changed

3 files changed

+105
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
<div class="container">
3+
<br/>
4+
<h2> <a href="http://geeksarray.com">Geeks Product List</a></h2>
5+
<div class="table-responsive">
6+
<table class="table table-striped" *ngIf = 'products && products.length' >
7+
<thead class="thead-dark">
8+
<tr>
9+
<th>ProductID</th>
10+
<th>ProductName</th>
11+
<th>CategoryId</th>
12+
<th>AvilableQty</th>
13+
<th>ReorderQty</th>
14+
</tr>
15+
</thead>
16+
<tbody>
17+
<tr *ngFor = 'let product of products'>
18+
<td>{{product.ProductID}}</td>
19+
<td>{{product.ProductName}}</td>
20+
<td>{{product.CategoryId}}</td>
21+
<td>{{product.AvilableQty}}</td>
22+
<td>{{product.ReorderQty}}</td>
23+
</tr>
24+
</tbody>
25+
</table>
26+
<div>
27+
</div>
28+
</div>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { ProductsComponent } from './products.component';
4+
5+
describe('ProductsComponent', () => {
6+
let component: ProductsComponent;
7+
let fixture: ComponentFixture<ProductsComponent>;
8+
9+
beforeEach(async(() => {
10+
TestBed.configureTestingModule({
11+
declarations: [ ProductsComponent ]
12+
})
13+
.compileComponents();
14+
}));
15+
16+
beforeEach(() => {
17+
fixture = TestBed.createComponent(ProductsComponent);
18+
component = fixture.componentInstance;
19+
fixture.detectChanges();
20+
});
21+
22+
it('should create', () => {
23+
expect(component).toBeTruthy();
24+
});
25+
});
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import { Component, OnInit } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-products',
5+
templateUrl: './products.component.html',
6+
styleUrls: ['./products.component.less']
7+
})
8+
export class ProductsComponent implements OnInit {
9+
10+
constructor() { }
11+
12+
ngOnInit() {
13+
}
14+
15+
products : any[] =[ {
16+
"ProductID" :1,
17+
"ProductName": "Solid State Drive",
18+
"CategoryId":100,
19+
"AvilableQty":50,
20+
"ReorderQty":30
21+
},
22+
{
23+
"ProductID" : 2,
24+
"ProductName": "Monitor",
25+
"CategoryId":101,
26+
"AvilableQty":20,
27+
"ReorderQty":10
28+
},
29+
{
30+
"ProductID" : 3,
31+
"ProductName" : "LED Display Monitor",
32+
"CategoryId":100,
33+
"AvilableQty":5,
34+
"ReorderQty":10
35+
},
36+
{
37+
"ProductID" : 4,
38+
"ProductName": "San Disk 64 GB Pen Drive",
39+
"CategoryId":105,
40+
"AvilableQty":35,
41+
"ReorderQty":80
42+
},
43+
{
44+
"ProductID" : 5,
45+
"ProductName": "Think Pad Ultra Dock",
46+
"CategoryId":105,
47+
"AvilableQty":25,
48+
"ReorderQty":20
49+
}
50+
51+
]
52+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /