Skip to content
This repository has been archived by the owner on Jul 10, 2018. It is now read-only.

Commit

Permalink
Enabling/disabling buttons depending on input field state (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtlynch committed May 2, 2018
1 parent a8481cf commit 4cdaadf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/app/public/home-page/home-page.component.html
Expand Up @@ -2,11 +2,11 @@
<span>Ingredient Parser Demo</span>
</mat-toolbar>
<form>
<mat-form-field class="input-full-width" floatPlaceholder="never">
<input matInput placeholder="2 cups brown sugar" name="ingredientRaw" [(ngModel)]="ingredientRaw">
<mat-form-field class="input-full-width" floatPlaceholder="never" hideRequiredMarker>
<input matInput placeholder="2 cups brown sugar" name="ingredientRaw" [(ngModel)]="ingredientRaw" required>
</mat-form-field>
<button mat-raised-button color="primary" (click)="parse(ingredientRaw)" [disabled]="isWaitingForParseResult">Parse</button>
<button mat-raised-button (click)="reset()">Reset</button>
<button mat-raised-button color="primary" (click)="parse(ingredientRaw)" [disabled]="isWaitingForParseResult || !ingredientRaw">Parse</button>
<button mat-raised-button (click)="reset()" [disabled]="!ingredientRaw">Reset</button>
</form>
<div *ngIf="isWaitingForParseResult">
<mat-spinner></mat-spinner>
Expand Down

0 comments on commit 4cdaadf

Please sign in to comment.