Reputation:
I have a click button that is suppose to hide after certain amount of inputs. I would like it to hide once it reaches a limit, but currently what is doing that it would only hide when it's clicked again. Which is a bad user experience.
private isAddUserVisible = true;
public limitedAmount() {
this.isAddUserVisible =
this.userL.length + this.service.getTotalLength() < this.userService.getTotalValue();
if (this.isAddUserVisible) {
this.userL.push(this.create());
}
}
<div class="add-icon-button medium-3 columns" *ngIf="this.isAddUserVisible" (click)="limitedAmount()">
Upvotes: 0
Views: 42