Created
October 29, 2017 06:34
-
-
Save tkssharma/96ca2c002b2fb11fe1bdd32a741e1c62 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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