question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How can I get form json in FormBuilder.component.ts file

See original GitHub issue

Hi ! I am new to this dynamic form builder and i have checked in code so i noticed that on save button click there are we have json of complete form which is we drag and drop in screen . So now i added one button and in this button click i want that json data.

`export class FormBuilderComponent implements OnInit { data: any; public myService: any; constructor(private dataService: DataService) { }

formBuilder: any; formData: any; ngOnInit(): void { initJq(); var actionButtons = [ { id: “smile”, className: “btn btn-success”, label: “😁”, type: “button”, events: { click: () => { this.dataService.addFormTemplate(); } } } ]; this.formBuilder = (<any>jQuery(‘.build-wrap’)).formBuilder({ actionButtons: actionButtons }); console.log(this.formBuilder); } } ` I want pass json data in click event of button

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
kevinchappellcommented, Apr 2, 2019

this.formBuilder will already be defined when the button is clicked so you can access the data using either this.formBuilder.actions.getData or this.formBuilder.formData

0reactions
ecmciasabellanocommented, Oct 6, 2020

Any update on this? Having the same problem. No other way to pass formBuilder data/options through custom actionButtons.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular: json to formBuilder to json - Stack Overflow
I know how I can build my form with the formbuilder but when I press submit I am having troubles with responding the...
Read more >
Creating Dynamic Angular Forms with JSON - Elite Ionic
In this tutorial, we walk through how to build a dynamic Angular form from a JSON data source.
Read more >
Create a Dynamic Reactive Angular Form with JSON - YouTube
In this video, we create a component that allows you to define form controls in a JSON file and then dynamically create a...
Read more >
Angular Form From Json - StackBlitz
Create Angular Reactive forms from json objects. ... import { Component } from '@angular/core';. import {FormGroup,FormControl,FormBuilder}.
Read more >
Different ways to get form data in Angular Component
It is one of the easiest and quickest way to get the form data into component file. For it, We mainly add hash(#)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found