kelp404 / angular-form-builder

Drag and drop to build bootstrap forms in AngularJS.
http://kelp404.github.io/angular-form-builder/
MIT License
599 stars 340 forks source link

Problems using the angular-form-builder #97

Open rodrigoimenes opened 8 years ago

rodrigoimenes commented 8 years ago

Hello,

So I implemented the angular-form-builder like a CRUD, to save and edit forms.

The question is when i go to "builder screen", and save or cancel data and back to this screen, the components are still here, so i made a change on removeFormObject method, to something like this:

    if (opt && opt == 'ERASE_FORM') {
      _this.forms[name] = [];
    } else {
      formObjects = _this.forms[name];
      formObjects.splice(index, 1);
    }
    return _this.reindexFormObject(name);

Removing all components with this code: $builder.removeFormObject(formName, 0, 'ERASE_FORM');

I know this code is very ugly, but when i come back to screen and create a new form, when i drag a component to builder, it simply disappears.

Do you guys have a sample or something to help me or some workaround?

Thanks for any help or suggestion.

Att,

rodrigoimenes commented 8 years ago

I also tried running the code commits below, but no success...

https://github.com/kelp404/angular-form-builder/pull/41/commits/a2229bee1d9a05567eab578c123832c543afc005

rodrigoimenes commented 8 years ago

Same error as this, but his solution doesn't work...

https://github.com/kelp404/angular-form-builder/issues/59