I need to find a way to determine the number of rows in my table without using the ngFor directive. Here is an example of what I am trying to achieve:
<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Name</th>
<th scope="col">IP</th>
<th scope="col">Session_ID</th>
</tr>
</thead>
<tbody>
<tr *ngFor='let obj of methodResponse; let theIndex = index;'>
<th scope="row"> {{theIndex + 1}}</th>
<td>{{obj.name}}</td>
<td>{{obj.sourceIp}}</td>
<td>{{obj.sessionId}}</td>
</tr>
<!-- Now, how do I get the total row count outside of the ngFor loop? -->
</tbody>
</table>
I have attempted to create a function within the ngFor loop but it did not work as expected. Can anyone provide any guidance on how to accomplish this?