Check for the width of div with *ngFor

Discussão em 'Angular' iniciado por The Hungry Dictator, Janeiro 12, 2025.

  1. I am working on a project where we have a requirement where I need to check whether total width of dynamically generated divs using *ngFor is bigger than the parent element or not. HTML looks as below

    <div class="emp_parent">
    <div class="emp_child" *ngFor="let emp of data;let i = index;">
    // some code goes here
    </div>
    </div>


    Here as you see in the above section I need to check total width of emp_child and also need to check whether it is going beyond emp_parent or not. Based on that I need to make other conditions. I am trying but I am not able to get the total width of dynamically generated emp_child's width. Any solution for this ?

    Continue reading...

Compartilhe esta Página