Skip to content

Commit

Permalink
#1 解决报错与展示数据的能力 #1 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
muyuqiu001 committed Feb 25, 2017
1 parent 50f6a0c commit fbf3a72
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 54 deletions.
39 changes: 39 additions & 0 deletions app/app.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<h1>{{title}}</h1>
<div>
<table border="2">
<thead>
<td>
Commit Id
</td>
<td>
Reivew Person
</td>
<td>
Review Time
</td>
<td>
Reivew File
</td>
<td>
Commit Person
</td>
</thead>
<tr *ngFor="let data of datas">
<td>
{{data.id}}
</td>
<td>
{{data.reviewer}}
</td>
<td>
{{data.reviewtime}}
</td>
<td>
{{data.file}}
</td>
<td>
{{data.committer}}
</td>
</tr>
</table>
</div>
74 changes: 26 additions & 48 deletions app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,37 @@ import { Component } from '@angular/core';

import { ReviewData } from './reviewdata';

const DATAS: ReviewData[] = [
{
id: "zkasdf1",
reviewer: "00316496",
reviewtime: "201702242200",
file: "12.txt",
committer: "00388224",
},
{
id: "zkasdf12",
reviewer: "00316496",
reviewtime: "201702232200",
file: "123.txt",
committer: "00388224",
},
{
id: "zkasdf123",
reviewer: "00316496",
reviewtime: "201702235200",
file: "1234.txt",
committer: "00388224",
},
];

@Component({
moduleId: module.id,
selector: 'my-app',
template: `
<h1>{{title}}</h1>
<div>
<table border="2">
<thead>
<td>
Commit Id
</td>
<td>
Reivew Person
</td>
<td>
Review Time
</td>
<td>
Reivew File
</td>
<td>
Commit Person
</td>
</thead>
<tr>
<td>
{{data.id}}
</td>
<td>
{{data.reviewer}}
</td>
<td>
{{data.reviewtime}}
</td>
<td>
{{data.file}}
</td>
<td>
{{data.committer}}
</td>
</tr>
</table>
</div>
`,
templateUrl:'app.component.html',
})

export class AppComponent {
title = 'The committed details of This Project';
data: ReviewData = {
id: "zkasdf1234",
reviewer: "00316496",
reviewtime: "201702242200",
file: "123.txt",
committer: "00388224",
};
datas = DATAS;
}
15 changes: 9 additions & 6 deletions app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { NgModule } from '@angular/core';
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';

import { AppComponent } from './app.component';
import { FormsModule } from '@angular/forms';
import { AppComponent } from './app.component';

@NgModule({
imports: [ BrowserModule ],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
imports: [
BrowserModule,
FormsModule
],
declarations: [AppComponent],
bootstrap: [AppComponent]
})
export class AppModule { }

0 comments on commit fbf3a72

Please sign in to comment.