He publishes many empty values

0

I am trying to generate a project, where I have a series of targets on one side and a series of articles on the other. So the idea is that I load those articles where those targets are and if they do not match that they do not show anything, for that I have generated the following code in the HTML file of the component:

<div *ngFor="let articulo of spiderService.articulos">
    <div *ngIf="articulo.titulo.includes(target.nombre)">
        <p *ngIf="true">{{articulo.titulo}} - test</p>
    </div>
</div>

My problem is that I have more than 3,200 articles and I am uploading the following code:

<div _ngcontent-c1="" class="card-stacked  col s12"></div>

This div generates it to me 15 times which is the number of targets that I have in the database, and within this div it generates me another 3.200 divs one per article, if the title of the article matches the name of the target me it shows perfect on the screen, but those that do not match generates that empty div, which gives me a lot of problems for the design and so on.

Any solution?

    
asked by Ramón Devesa 20.12.2018 в 15:26
source

0 answers