|
|
@ -1,22 +1,16 @@ |
|
|
|
import { HttpResponse } from '@angular/common/http'; |
|
|
|
import { Component, OnInit } from '@angular/core'; |
|
|
|
import { Component } from '@angular/core'; |
|
|
|
import { FormControl } from '@angular/forms'; |
|
|
|
|
|
|
|
import { Task } from './task'; |
|
|
|
import { TaskService } from './task.service'; |
|
|
|
|
|
|
|
@Component({ |
|
|
|
selector: 'my-app', |
|
|
|
templateUrl: './app.component.html', |
|
|
|
styleUrls: ['./app.component.css'], |
|
|
|
}) |
|
|
|
export class AppComponent implements OnInit { |
|
|
|
tasks: Task[] = []; |
|
|
|
export class AppComponent { |
|
|
|
readonly condition = new FormControl(); |
|
|
|
|
|
|
|
constructor(private taskService: TaskService) {} |
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
this.taskService.getList().subscribe((res: HttpResponse<any>) => { |
|
|
|
this.tasks = res.body; |
|
|
|
}); |
|
|
|
onSearch(): void{ |
|
|
|
console.log(`查詢條件:${this.condition.value}`); |
|
|
|
} |
|
|
|
} |