1
div에 ngIf를 넣으려고 시도하고 요소에 ngFor를 넣으려고합니다. 내 HTML 구성 요소에서이 있습니다 : 나는 이유를 이해 해달라고ng 내부에 무한 루프가있는 경우
matching(valor) : boolean {
var resultado : boolean = true;
if(valor.toString.match(this.filtertext) == null){
resultado = false;
}
return resultado;
}
하지만 ngIf이 기능을 항상 호출
<td id="fila{{registro.id}}" *ngFor="let campo of cabeceras">
<div *ngIf="matching(registro[campo])">{{registro[campo]}}</div>
</td>
또한, 내 component.ts의 일치() 함수는 .
감사합니다.
@Sajeetharan하지만하지 n 번을 만들어에
는, 그것의 단지 무한한를 사전에 결과의 배열을 생성하고 인덱스를 소개
대신이 배열에 바인딩! –
cabeceras, registro 및 filtertext의 예제 데이터를 제공 할 수 있습니까? – Chandru