diff --git a/src/userService.ts b/src/userService.ts index 14c9181..7181ba8 100644 --- a/src/userService.ts +++ b/src/userService.ts @@ -2,9 +2,9 @@ import {IUserService} from "./iuserService"; export class UserService implements IUserService { public getUsers(): Array { let users: Array = [ - { id: 1, firstName: "Tu", lastName: "Tran", userName: "tutran" }, - { id: 2, firstName: "Tu 1", lastName: "Tran", userName: "tutran2" }, - { id: 3, firstName: "Tu 2", lastName: "Tran", userName: "tutran3" } + { id: 1, firstName: "Tu", lastName: "Tran", userName: "tutran", color:"red" }, + { id: 2, firstName: "Tu 1", lastName: "Tran", userName: "tutran2" , color:"blue"}, + { id: 3, firstName: "Tu 2", lastName: "Tran", userName: "tutran3" , color:"green"} ]; return users; } diff --git a/src/users.html b/src/users.html index 3b51fd9..4fe31c1 100644 --- a/src/users.html +++ b/src/users.html @@ -12,13 +12,28 @@ {{user.id}} - {{user.firstName}} + {{user.lastName}} {{user.userName}} + +
+

Summary of {{currentSelected.firstName}}

+
+
+ + +
+
+ + +
+
+
+ \ No newline at end of file diff --git a/src/users.ts b/src/users.ts index 5fc67b5..cfcc420 100644 --- a/src/users.ts +++ b/src/users.ts @@ -3,11 +3,16 @@ import { Router } from "@angular/router"; import { UserService } from "./userService"; @Component({ selector: "users", - templateUrl: "src/users.html" + templateUrl: "src/users.html", + styles: ['table th{font-size: 20px;}'] }) export class Users { private users: Array = []; + public currentSelected: any = null; constructor(userService: UserService) { this.users = userService.getUsers(); } + public onPreviewClicked(user: any) { + this.currentSelected = user; + } } \ No newline at end of file