<h2>Lista produktów</h2>
<ul>
<li *ngFor="let product of products | sort" (click)="selectedProduct = product">
{{product.name}}
</li>
</ul>
<app-product-detail
   *ngIf="selectedProduct; else noProduct"
   [id]="selectedProduct.id"
   (deleted)="onDelete()"
   (bought)="onBuy()">
</app-product-detail>

<ng-template #noProduct>
  <p>Nie wybrano żadnego produktu!</p>
</ng-template>

<app-product-create (added)="onAdd($event)"></app-product-create>



