|
|
@ -1,4 +1,5 @@ |
|
|
|
import { Component } from '@angular/core'; |
|
|
|
import { NgModel } from '@angular/forms'; |
|
|
|
|
|
|
|
@Component({ |
|
|
|
selector: 'my-app', |
|
|
@ -6,9 +7,10 @@ import { Component } from '@angular/core'; |
|
|
|
styleUrls: ['./app.component.css'], |
|
|
|
}) |
|
|
|
export class AppComponent { |
|
|
|
condition = ''; |
|
|
|
|
|
|
|
onSearch(): void { |
|
|
|
console.log(`查詢條件:${this.condition}`); |
|
|
|
result=''; |
|
|
|
onSearch(condition:NgModel): void { |
|
|
|
console.log(`查詢條件:${condition.value}`); |
|
|
|
this.result=condition.value; |
|
|
|
} |
|
|
|
} |