How to use Template variable #amount to get select option quantitay of product the same in the cart using Angular

Viewed 20

I want to know how to use this code with service and with cart component, to get the amount which selected by the user on the product list page What I have to write in product-list.component.ts + cart.service + cart.component.ts

this is product-list.html

 <div class="form-floating" >
                 <select #amount  class="form-select" id="floatingSelect" aria-label="Floating label select example" >
                   
                   <option   *ngFor="let number of [1,2,3,4,5,6,7,8,9,10]" [value]="number"> {{number}} </option>
                 
                 </select>
                 <label for="floatingSelect">Quantity</label>
               </div>
            </div>
           
         
       
         
        <div class="buttons">
         <button  class="btn btn-primary"  (click)="addToCart(product )">Add to cart</button>
0 Answers
Related