title: Form.io form builder how to emit or submit data
body: <p>I am building a dynamic drag and drop form builder and i cant find a way to console log out the data of the form. here is the form <code>component.html</code> in which i am rendering the drag and drop form</p>
  <pre class="lang-html prettyprint-override"><code> &lt;div&gt;
      
      &lt;form-builder [form]=&quot;form&quot; (change)=&quot;onChange($event)&quot; (submit)=&quot;onSubmit($event)&quot;&gt;&lt;/form-builder&gt;
      
      &lt;div class=&quot;well jsonviewer&quot;&gt;
        &lt;pre id=&quot;json&quot;&gt;&lt;code class=&quot;language-json&quot; #json&gt;&lt;/code&gt;&lt;/pre&gt;
      &lt;/div&gt;
      
  &lt;/div&gt;
  </code></pre>
  <p>And here is the <code>component.ts</code> I just wanted to console the form data out then I will send it to the
  API to be saved.</p>
  <pre class="lang-js prettyprint-override"><code>    import { Component, OnInit, ElementRef, ViewChild } from '@angular/core';
      
      @Component({
        selector: 'app-user-add',
        templateUrl: './user-add.component.html',
        styleUrls: ['./user-add.component.css']
      })
      export class UserAddComponent implements OnInit {
        title = 'ASW Form Builder Demo';
        jsonData:any[]=[];
        @ViewChild('json') jsonElement?: ElementRef;
      
        constructor() { }
      
        ngOnInit(): void {
        }
      
        // Publish Template
        saveJsonData(data: any){
          //.... 
          console.log(data);
          // do something
        }
        
        //Preview Template
        previewTemplate(data: any){
          this.jsonData = data;
        }
      
        public form: Object = {components: []};
        onChange(event) {
          console.log(event.form);
        }
      
        onSubmit(param){
        console.log(param);
        }
      }
  </code></pre>
  <p>Can anyone help me fetch the data from the form on submit? and can i do this on another division and button outside the form? I wanted to use my own submit button. or is there any tutorial that can explain this starting from the database design?</p>