|
|
@ -1,6 +1,5 @@ |
|
|
|
import { Component } from '@angular/core'; |
|
|
|
|
|
|
|
import { Task } from './task'; |
|
|
|
|
|
|
|
@Component({ |
|
|
|
selector: 'my-app', |
|
|
@ -8,21 +7,5 @@ import { Task } from './task'; |
|
|
|
styleUrls: [ './app.component.css' ] |
|
|
|
}) |
|
|
|
export class AppComponent { |
|
|
|
tasks: Task[] = [ |
|
|
|
new Task({ TaskSn: '001', TaskName: '待辦事項 A', State: 'Finish' }), |
|
|
|
new Task({ TaskSn: '002', TaskName: '待辦事項 B', State: 'Doing' }), |
|
|
|
new Task({ TaskSn: '003', TaskName: '待辦事項 C', State: 'None' }), |
|
|
|
new Task({ TaskSn: '004', TaskName: '待辦事項 D', State: 'None' }), |
|
|
|
]; |
|
|
|
trackByItems(index:number, task:Task):string{ |
|
|
|
return task.TaskSn; |
|
|
|
} |
|
|
|
onReset():void{ |
|
|
|
this.tasks=[ |
|
|
|
new Task({ TaskSn: '001', TaskName: '待辦事項 A', State: 'Finish' }), |
|
|
|
new Task({ TaskSn: '002', TaskName: '待辦事項 B', State: 'Doing' }), |
|
|
|
new Task({ TaskSn: '004', TaskName: '待辦事項 C', State: 'None' }), |
|
|
|
new Task({ TaskSn: '005', TaskName: '待辦事項 D', State: 'None' }), |
|
|
|
]; |
|
|
|
} |
|
|
|
} |
|
|
|
|