0
I have a problem in ngFor
, because I want to enable the + button only when an item in the list is selected. But my widget option
does not accept Event bind (click)
. Can you help me?
<div class="container">
<div class="row">
<button (click)="setItem()">Items</button>
<select class="custom-select">
<option *ngFor="let item of itemSelecionado">{{ item }}</option>
</select>
</div>
</div>
<div class="container">
<button class="btn btn-primary" type="button" [disabled]="isActive">+</button>
</div>
itemSelecionado = [];
items = ['Teste A', 'Teste B', 'Teste C', 'Teste D', 'Teste E'];
isActive = true;
setItem(){
this.itemSelecionado = this.items;
console.log(this.itemSelecionado);
}
I have already tried to create the method below and use it in option
, but it didn’t work out:
liberaBtn() {
this.isActive = false;
}
What will this button do? Add more fields ?
– NoobSaibot