Created
August 22, 2017 01:21
-
-
Save travist/79d4d415e6b85fae13a73e7e23f0566b to your computer and use it in GitHub Desktop.
Send form submission to custom API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component } from '@angular/core'; | |
| import { FormioService } from 'ng2-formio'; | |
| @Component({ | |
| template: '<formio *ngIf="form" form="[form]" (submit)="onSubmit($event)"></formio>' | |
| }) | |
| export class FormioFormExample { | |
| public form: object; | |
| public service: FormioService; | |
| constructor() { | |
| this.service = new FormioService('https://examples.form.io/example'); | |
| this.service.loadForm().subscribe((form: object) => { | |
| this.form = form; | |
| }); | |
| } | |
| onSubmit(submission:object) { | |
| // Send the submission to your own api here... | |
| console.log(submission); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment