Require some text while searching

This commit is contained in:
Simon Hanna 2018-08-22 22:19:41 +02:00
parent 0ea24dd23c
commit 19981ad608

View File

@ -1,5 +1,5 @@
<h3>Search</h3> <h3>Search</h3>
<form> <form #searchForm="ngForm">
<mat-form-field> <mat-form-field>
<mat-select [(ngModel)]="selectedPlugin" name="selectedPlugin" placeholder="Search for:"> <mat-select [(ngModel)]="selectedPlugin" name="selectedPlugin" placeholder="Search for:">
<mat-option *ngFor="let plugin of searchPlugins" name="searchPlugins" [value]="plugin.key"> <mat-option *ngFor="let plugin of searchPlugins" name="searchPlugins" [value]="plugin.key">
@ -9,10 +9,10 @@
</mat-form-field> </mat-form-field>
<br> <br>
<mat-form-field> <mat-form-field>
<input matInput [(ngModel)]="searchText" name="searchText" placeholder="Search Text"> <input matInput [(ngModel)]="searchText" name="searchText" placeholder="Search Text" required>
</mat-form-field> </mat-form-field>
<br> <br>
<button mat-raised-button id="searchButton" color="primary" (click)="onSubmit()">Search</button> <button mat-raised-button id="searchButton" color="primary" [disabled]="!searchForm.form.valid" (click)="onSubmit()">Search</button>
</form> </form>
<div *ngIf="searchResults"> <div *ngIf="searchResults">
<h3>Search Results:</h3> <h3>Search Results:</h3>