Angular Integration Guide
Complete guide to integrate MyFormCapture with Angular
Submit an Angular contact form to MyFormCapture with the browser fetch API and FormData. No custom Nest/Express backend required.
Prerequisites
- A MyFormCapture account — sign up here
- A form created in your MyFormCapture dashboard with its UUID copied
- An Angular project
- Basic template-driven or reactive forms familiarity
Integration Methods
fetch + FormData
Use a template-driven form, build FormData from the native form element, and POST with fetch. Prefer this over JSON.stringify or setting Content-Type manually.
Copy your form UUID
- Log in to your MyFormCapture dashboard
- Open the form
- Copy the form UUID
Important Note
Add the Angular contact form
FormData via fetch.
- Generate or create a
ContactFormcomponent - Replace
YOUR_FORM_UUIDwith your UUID - Add the component to your contact route
import { Component } from '@angular/core';
@Component({
selector: 'app-contact-form',
standalone: true,
template: `
<p *ngIf="status === 'success'">Thanks — we will be in touch soon.</p>
<form *ngIf="status !== 'success'"
action="https://myformcapture.com/f/YOUR_FORM_UUID"
method="POST"
data-mfc="true"
(submit)="onSubmit($event)">
<label for="name">Name *</label>
<input id="name" name="name" type="text" required />
<label for="email">Email *</label>
<input id="email" name="email" type="email" required />
<label for="message">Message</label>
<textarea id="message" name="message" rows="4"></textarea>
<button type="submit" [disabled]="status === 'loading'">
{{ status === 'loading' ? 'Sending…' : 'Send Message' }}
</button>
<p *ngIf="status === 'error'">{{ errorMessage }}</p>
</form>
`
})
export class ContactFormComponent {
endpoint = 'https://myformcapture.com/f/YOUR_FORM_UUID';
status: 'idle' | 'loading' | 'success' | 'error' = 'idle';
errorMessage = '';
async onSubmit(e: Event) {
e.preventDefault();
const form = e.target as HTMLFormElement;
this.status = 'loading';
this.errorMessage = '';
try {
const res = await fetch(this.endpoint, {
method: 'POST',
headers: {
Accept: 'application/json',
'X-Requested-With': 'XMLHttpRequest'
},
body: new FormData(form)
});
if (!res.ok) throw new Error('Submission failed');
this.status = 'success';
form.reset();
} catch {
this.status = 'error';
this.errorMessage = 'Something went wrong. Please try again.';
}
}
}
Important Note
fetch + FormData as shown. If you prefer HttpClient, still send FormData as the body — never JSON.stringify the fields.
Test in the browser
- Serve the app and open the contact page
- Fill in the form and submit
- Check Leads or Form Responses in the dashboard
Important Note
http://localhost:4200 under Domains if Domain Restriction is enabled.
Related Integrations
References & Official Documentation
Next Steps
Configure MyFormCapture
- Set up your timezone
- Configure lead notifications
- Set up advanced spam detection
- Add team members to your account
Advanced Features
- Use our custom form templates
- Try AI Insights for Leads
- Integrate with your CRM
- Set up automated workflows