Skip to content

Instantly share code, notes, and snippets.

@tkssharma
Created October 29, 2017 06:34
Show Gist options
  • Save tkssharma/96ca2c002b2fb11fe1bdd32a741e1c62 to your computer and use it in GitHub Desktop.
Save tkssharma/96ca2c002b2fb11fe1bdd32a741e1c62 to your computer and use it in GitHub Desktop.
import { Component } from '@angular/core';
export class User {
id: number;
name: string;
username: string;
avatar: string;
}
const users: User[] = [
{
id: 1,
name: 'Tarun',
username: 'tkssharma'
},
{
id: 2,
name: 'giri',
username: 'tkssharma'
},
{
id: 3,
name: 'Jhn',
username: 'tkssharma',
}
]
@Component({
selector: 'about-page',
template: `
<div class="row" *ngIf="users">
<div class="col-sm-4" *ngFor="let user of users">
<div class="profile-card">
<img [src]="user.avatar" class="img-responsive img-circle">
<h2>{{ user.name }}</h2>
<p><a href="#">{{ user.username }}</a></p>
</div>
</div>
</div>
`
})
export class AboutComponent {
users: User[] = users;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment