Well, *ngFor *is* the repeater for Angular, if you want to use it. I'm not 
sure if you just got the syntax wrong or you're asking for something more 
complex.

In case it's just about syntax, you have to do something like this:

<div *ngFor="let user of users">
  {{ user.name }}
</div>

Maybe you also want to show the numbers, something like this:

<ul *ngFor="let user of users; index as i;">
  <li> {{ i + 1 }} - {{ user.name }} </li>
</ul>

Or like a table, you want to highlight even (or odd)  rows:

<table>
  <tbody>
    <tr *ngFor="let user of users; even as isEven; odd as isOdd" 
[ngClass]="{ highlight: isEven }">
      <td>{{ user.name }} </td>
    </tr>
  </tbody>
</table>

You can also get a boolean if it's the first or last entry. More in the 
docs:

https://angular.io/api/common/NgForOf



On Thursday, July 27, 2017 at 7:36:33 PM UTC+2, random512 wrote:
>
> A basic use case from my perspective would be to display a parent div with 
> several formatted child divs of the same type with different data. For 
> example, display first name of each user in a collection in repeating divs. 
> The following implementation is not valid ng2 but should show what I'm 
> looking for: 
>
> <div *ngFor="users">
> <div>{user.FirstName}</div>
> </div>
>
> Can you post a url that provides a good sample implementation along these 
> lines?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to