I'm working on a list of values in my web-app. There I'm facing the following problem:
app.component.html
This part of the code shows my array as a list:
<div class="body__tags">
<ng-container *ngFor="let tag of tags; let i=index">
<li class="tags__list" *ngIf="i<5" [label]="tag"></li>
</ng-container>
</div>
Here I set limit of 5 values in my list. But sometimes there are more than 5 values in the array. How can I add a button "show all" and then display everything in that list?
app.component.ts
This is my ts code:
tags:any[];
splitTags() {
if (this.data.tags != null) {
this.tags = this.data.tags.split(";");
console.log(this.tags)
}
}
ngOnInit() {
this.splitTags()
}