Skip to content

Instantly share code, notes, and snippets.

@crh225
Created February 17, 2020 01:41
Show Gist options
  • Select an option

  • Save crh225/df6fb1c7b77c87e1685a8e14a46a4372 to your computer and use it in GitHub Desktop.

Select an option

Save crh225/df6fb1c7b77c87e1685a8e14a46a4372 to your computer and use it in GitHub Desktop.
angularfire-form.ts
<form class="job-form" [formGroup]="jobForm">
<mat-form-field class="full-width">
<mat-label>Company</mat-label>
<input matInput placeholder="Ex. Google" formControlName="company" required>
<mat-error *ngIf="!jobForm.get('company').valid">Required</mat-error>
</mat-form-field>
<mat-form-field class="full-width">
<mat-label>Job Title</mat-label>
<input matInput placeholder="Ex. Sr. Software Engineer" formControlName="title" required>
<mat-error *ngIf="!jobForm.get('title').valid">Required</mat-error>
</mat-form-field>
<mat-form-field class="full-width">
<mat-label>Salary</mat-label>
<input matInput placeholder="Ex. 60 per hour" formControlName="salary">
</mat-form-field>
<mat-form-field class="full-width">
<mat-label>Job Description</mat-label>
<textarea matInput placeholder="Ex. Looking for an Angular developer..."
formControlName="description" required></textarea>
<mat-error *ngIf="!jobForm.get('description').valid">Required</mat-error>
</mat-form-field>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment