Dont allow negative quantities

This commit is contained in:
Zakary Timson 2018-07-22 11:52:11 -04:00
parent 91e40929e0
commit fac4a7b31e

View File

@ -7,7 +7,7 @@
<mat-form-field class="mr-1" style="width: 40px">
<input #quantity matInput type="number" value="1" min="1">
</mat-form-field>
<button mat-raised-button color="primary" (click)="app.addToCart(product.id, product.name, product.price, quantity.value)">
<button mat-raised-button color="primary" [disabled]="quantity.value < 1" (click)="app.addToCart(product.id, product.name, product.price, quantity.value)">
<mat-icon>add_shopping_cart</mat-icon> Buy
</button>
</div>