-2
Wanted a help with angular, I use an ngFor to generate the buttons "-" and "+" which are the buttons that give choice to the user. So when it comes to choosing options such as the flavor of the pizza I wanted when it clicked on some flavor that "+" button would disappear.. understand ?
<ion-list *ngIf="varia.eMax > 1">
<ng-container *ngFor="let item of itensVaria">
<ion-item class="compact" *ngIf="item.idPV == varia.idPV">
<ion-row no-padding>
<ion-col col-7 style="text-align: left;">
<h2 class="h2">Descrião do item</h2>
</ion-col>
<ion-col col-5>
<button ion-button icon-only clear color="danger" (click)="changeQty(item, varia, -1)">
<ion-icon name="remove-circle"></ion-icon>
</button>
<!-- <button ion-button clear color="danger"> qtd do item </button> -->
<button ion-button icon-only clear color="danger" (click)="changeQty(item, varia, 1)">
<ion-icon name="add-circle"></ion-icon>
</button>
</ion-col>
</ion-row>
</ion-item>
</ng-container>
But as there are several flavors and the user can choose only at most 3 and at least 2 for example I wanted to click x flavor the button related to this flavor is unavailable indicating that he has already clicked on this flavor!
I edited the question that way I know how to do it, but leave with everyone I want you to do according to the item!
– SIG Automação
@Sigautomation updated the answer
– Lucas Brogni
It didn’t work. It’s a mistake;
Typescript Error
Property 'includes' does not exist on type 'any[]'.
– SIG Automação
@Sigautomation passed the wrong code, Sorry. includes is only for string
– Lucas Brogni
@Sigautomation posted the right copy.
– Lucas Brogni
Thank you was very good.... now how do I show the quantity referred between a button and another ?
– SIG Automação
@Sigautomation sorry, I did not understand what you meant by the quantity referred.
– Lucas Brogni
Example: when I click on the button it adds the item right? Then I wanted it to show the amount of each item between a button and another. in my code above has a commented part between the two buttons!
– SIG Automação
You can add + that once the same item?
– Lucas Brogni
yes............
– SIG Automação
@Sigautomation if you can open another question by posting the code of your changeQty function that is easier
– Lucas Brogni
ai is the link to the question https://answall.com/questions/318728/mostar-quantidades-chosen
– SIG Automação