Skip to content

Commit 3c99965

Browse files
committed
feat: add input
1 parent ec80b13 commit 3c99965

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

frontend/src/angular/src/app/mcp-client/mcp-client.component.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@
2424
</div>
2525
</div>
2626
</mat-toolbar>
27+
<form #userForm="ngForm" (ngSubmit)="submitForm()">
2728
<div class="my-input-container">
2829
<div class="my-textarea">
2930
<mat-form-field class="example-full-width">
3031
<mat-label>Query about books or movies</mat-label>
31-
<textarea matInput placeholder="Ask about books or movies."></textarea>
32+
<textarea matInput placeholder="Ask about books or movies." [(ngModel)]="query"></textarea>
3233
</mat-form-field>
3334
</div>
3435
<div class="my-button">
35-
<button matButton="filled">Basic</button>
36+
<button matButton="filled" type="submit">Basic</button>
3637
</div>
37-
</div>
38+
</div>
39+
</form>

frontend/src/angular/src/app/mcp-client/mcp-client.component.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*/
1313
import { CommonModule } from '@angular/common';
1414
import { Component } from '@angular/core';
15+
import { FormsModule } from '@angular/forms';
1516
import { MatButtonModule } from '@angular/material/button';
1617
import { MatToolbarModule } from '@angular/material/toolbar';
1718
import {MatInputModule} from '@angular/material/input';
@@ -25,18 +26,25 @@ import { Router } from '@angular/router';
2526
MatToolbarModule,
2627
MatButtonModule,
2728
MatInputModule,
28-
MatFormFieldModule
29+
MatFormFieldModule,
30+
FormsModule
2931
],
3032
templateUrl: './mcp-client.component.html',
3133
styleUrl: './mcp-client.component.scss'
3234
})
3335
export class McpClientComponent {
36+
protected query: string = '';
37+
3438
constructor(private readonly router: Router) {}
3539

3640
protected showList(): void {
3741
this.router.navigate(['/doclist']);
3842
}
3943

44+
protected submitForm(): void {
45+
console.log(this.query);
46+
}
47+
4048
protected logout(): void {
4149
}
4250
}

0 commit comments

Comments
 (0)