1
listNotas() {
this.service.getList(this.idAluno).subscribe(
data => {
this.error = data.error;
this.list = data.message;
console.log(this.list);
},
err => console.log(err)
);
}
status:Boolean=false;
myToggle(i){
this.status[i] = true;
console.log(this.status[i]);
}
<div *ngFor="let data of list; let i = index">
<span>
{{data.aula}}
<ion-toggle (click)="myToggle(i)"></ion-toggle>
</span>
<span *ngIf="status == true">
{{data.nome}}
</span>
</div>
not missing accessing the status variable[i]? in if
– Willian
What is the layout of the returned json?
– novic
@Virgilionovic, I edited the question and included an image with json returned
– Henrique Mendes Silveira Rodri
@Henriquemendessilveirarodri has the status field is by this field???
– novic
yes, but the toogle function is boolean and I can’t use this field to run individually, inside ngFor...
– Henrique Mendes Silveira Rodri