Skip to content

Commit 7251234

Browse files
committed
adding two way binding and using some pipes to format currency and some other values
1 parent c94954b commit 7251234

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

APM - Start/app/products/product-list.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
<div class='row'>
99
<div class='col-md-2'>Filter by:</div>
1010
<div class='col-md-4'>
11-
<input type='text' />
11+
<input [(ngModel)]='listFilter' type='text' />
1212
</div>
1313
</div>
1414
<div class='row' >
1515
<div class='col-md-6'>
16-
<h3>Filtered by: </h3>
16+
<h3>Filtered by: {{listFilter}}</h3>
1717
</div>
1818
</div>
1919

@@ -45,13 +45,13 @@ <h3>Filtered by: </h3>
4545
{{product.productName}}
4646
</td>
4747
<td>
48-
{{product.productCode}}
48+
{{product.productCode | lowercase}}
4949
</td>
5050
<td>
5151
{{product.releaseDate}}
5252
</td>
5353
<td>
54-
{{product.price}}
54+
{{product.price | currency:'USD':true:'1.2-2'}}
5555
</td>
5656
<td>
5757
{{product.starRating}}

APM - Start/app/products/product-list.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export class ProductListComponent{
99
imageWidth: number = 50;
1010
imageMargin: number = 2;
1111
showImage: boolean = false;
12+
listFilter: string = 'cart';
1213
products: any[] = [
1314
{
1415
"productId": 1,

0 commit comments

Comments
 (0)