Skip to content

Instantly share code, notes, and snippets.

@vorpal56
Last active September 30, 2020 14:31
Show Gist options
  • Save vorpal56/18e3b746c984eccb32ff10b91cae2e33 to your computer and use it in GitHub Desktop.
Save vorpal56/18e3b746c984eccb32ff10b91cae2e33 to your computer and use it in GitHub Desktop.
Contact form without a server using Angular - contact.component.html without Material
<form class="contact" [formGroup]="form" method="post" (ngSubmit)="onSubmit()">
Name
<input [formControl]="name" required>
Email
<input [formControl]="email" placeholder="email@example.com" required>
Message
<textarea [formControl]="message" maxlength="256" placeholder="I'm interested in..." required></textarea>
<button [disabled]="isLoading" class="submit" type="submit">Submit</button>
<input [formControl]="honeypot" class="hidden" type="text" />
<div [ngClass]="!submitted? 'hidden' : 'visible'" class="center-text">
<span>{{responseMessage}}</span>
</div>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment