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

Commit

Permalink
Adding clearer placeholder and a reset button (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtlynch committed May 2, 2018
1 parent 7e064c4 commit b29418b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app/public/home-page/home-page.component.html
Expand Up @@ -2,10 +2,11 @@
<span>Ingredient Parser Demo</span>
</mat-toolbar>
<form>
<mat-form-field class="input-full-width">
<input matInput placeholder="Ingredient to parse" value="1/2 cup sugar" name="ingredientRaw"[(ngModel)]="ingredientRaw">
<mat-form-field class="input-full-width" floatPlaceholder="never">
<input matInput placeholder="2 cups brown sugar" name="ingredientRaw" [(ngModel)]="ingredientRaw">
</mat-form-field>
<button mat-raised-button color="primary" (click)="parse(ingredientRaw)" [disabled]="isWaitingForParseResult">Parse</button>
<button mat-raised-button (click)="reset()">Reset</button>
</form>
<div *ngIf="isWaitingForParseResult">
<mat-spinner></mat-spinner>
Expand Down
5 changes: 5 additions & 0 deletions src/app/public/home-page/home-page.component.ts
Expand Up @@ -30,4 +30,9 @@ export class HomePageComponent implements OnInit {
});
}

reset() {
this.ingredientRaw = '';
this.parseResult = null;
}

}

0 comments on commit b29418b

Please sign in to comment.