So, whenever I call/click unRelatedFunction()
it makes the ngFor
loop re-render again. Is there any way to avoid this unwanted connection? I am using Angular 12.
please let me know if I am missing any required information. Thanks
//html
<div *ngFor="let item of arr">{{ create(item) }}</div>
<button type="button" (click)="unRelatedFunction()">test</button>
//ts
arr = [1, 2, 3, 4, 5, 6, 7];
create(val) {
console.log("again ?");
return val + 1
}
unRelatedFunction() {
console.log("test");
}