I am trying to enhance the appearance of the last line of controls generated by an iterator by making it disabled and somewhat invisible. Currently, my code is functioning well, as shown below.
<div *ngFor="let item of data; let last = last;">
<input class="form-control"
[value]="item.e"
[disabled]="last">
<button (click)="onRemove(item)"
class="btn btn-outline-danger"
[style.visibility]="last?'hidden':''">Do</button>
</div>
I want to improve the quality of my code, particularly the management of visibility aspect. The disability setting looks good, but the visibility conditional seems cumbersome.
What would be a better way to handle visibility control in a more elegant manner?
I attempted the following approach, but it did not work.
<button (click)="onRemove(item)"
class="btn btn-outline-danger"
[style.visibility.hidden]="last">Do</button>