Skip to content

Commit

Permalink
Added refresh feature (for reference only)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeborahK committed Aug 23, 2019
1 parent ac2a79d commit ac098fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions APM-WithExtras/src/app/products/product-list.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
class="btn btn-outline-secondary"
(click)="onAdd()">Add Product
</button>
<button type="button"
<!-- <button type="button"
class="btn btn-outline-secondary"
(click)="onRefresh()">Refresh Data
</button>
</button> -->
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions APM-WithExtras/src/app/products/product.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class ProductService {
private suppliersUrl = this.supplierService.suppliersUrl;

// All products
productsOriginal$ = this.http.get<Product[]>(this.productsUrl)
products$ = this.http.get<Product[]>(this.productsUrl)
.pipe(
tap(data => console.log('Products', JSON.stringify(data))),
catchError(this.handleError)
Expand All @@ -30,7 +30,7 @@ export class ProductService {
// To support a refresh feature
private refresh = new BehaviorSubject<boolean>(true);

products$ = this.refresh
products2$ = this.refresh
.pipe(
mergeMap(() => this.http.get<Product[]>(this.productsUrl)
.pipe(
Expand Down

0 comments on commit ac098fe

Please sign in to comment.