Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

277
Views
why do I get a blank space in the false element statements

hello I'm getting a blank space in the page and that's what I get when I want to inspect the page bindings={ "ng-reflect-ng-if": "false" } and I found out that I'm getting a a blank cards here is an image for it : enter image description here

`<section class="play-n-win-section">
  
  <h1 class="play-n-win-paragraph">play N Win</h1>
 <div class="card-container">
 <div *ngFor="let item of games; index as i">
 
    <mat-card class="cards" *ngIf="i <= 11">
        <mat-card-header>
            <mat-card-title>{{item.game_name}}</mat-card-title>
            <mat-card-subtitle>{{item.game_description}}</mat-card-subtitle>
          </mat-card-header>
          <div class="game-cover-container">  
            <img class="game-cover" mat-card-image src="{{item.game_cover_url}}" alt="{{item.game_name}}">
          </div>
          <mat-card-content>
            <p>
              Lorem Ipsum is simply dummy text of the printing and typesetting industry.
              Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,was 
              popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages
            </p>
          </mat-card-content>
      </mat-card>
   
</div>
</div>
<a mat-button routerLink="playandwin ">Link</a>
</section>`
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The ngfor is creating those extra elements because they are in the array (games) that you are ngFor-ing

The solution is to instead ngFor over a smaller array, or use a pipe

In your class

get first12Games(){
return this.games ? this.games.slice(0,12) : [];
}

Then in the html

*ngFor="let item of first12Games;

And then you won't have to use *ngIf="i<=11"

Technically it's best practice to use pipes https://angular.io/guide/pipes for this, but an optimization like that isn't a concern in a smaller project.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!