Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. </div>
  2. <span class="input-group-btn">
  3. <button type="button" id="decrease" value="DecreaseValue" class="quantity-left-minus btn btn-success btn-number" data-type="minus" data-field="" (click)="decreaseValue()">
  4. <span class="glyphicon glyphicon-minus">-</span>
  5. </button>
  6. </span>
  7. <input type="text" id="number" name="quantity" class="form-control input-number" value="{{value}}">
  8. <span class="input-group-btn">
  9. <button type="button" id="increase" value="Increase Value" class="quantity-right-plus btn btn-success btn-number" data-type="plus" data-field="" (click)="increaseValue()">
  10. <span class="glyphicon glyphicon-plus">+</span>
  11. </button>
  12. </span> </li>
  13. <li class="list-group-item d-flex justify-content-between">
  14. <h6 class="my-0">Total cost in Euros </h6>
  15. <p>{{price | currency : "€" }}</p>
  16. </li>
  17.  
  18. constructor(private http: HttpClient,
  19. private route: ActivatedRoute,
  20. private ps: ProductShopService
  21. ) { this.value = this.ps.value,
  22. this.price = this.ps.price}
  23.  
  24. constructor(private http: HttpClient,
  25. private route: ActivatedRoute,
  26. private ps: ProductShopService
  27. ) { this.value = this.ps.value,
  28. this.price = this.ps.price}
  29.  
  30. export class ProductShopService {
  31. // shopping cart start
  32. value: number = 1;
  33. price: number = 20;
  34. paypalLoad: boolean;
  35.  
  36.  
  37. increaseValue(){
  38. this.value= ++this.value;
  39. this.price= 20*this.value;
  40. }
  41.  
  42. decreaseValue(){
  43. if(this.value < 2 ){
  44. this.value = 1
  45. }else{
  46. this.value = --this.value;
  47. }
  48.  
  49. //this.value= --this.value;
  50. this.price= 20*this.value;
  51. }
  52. constructor() { }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement