danhunsaker / angular-dynamic-forms

Build Forms in AngularJS From Nothing But JSON (please see Alternatives in the README)
MIT License
379 stars 140 forks source link

Help needed with loading the Dynamic form on Button Click #14

Closed RaviChotrani closed 10 years ago

RaviChotrani commented 10 years ago

Hi,

I am following this dynamic form generation to read my JSON response and load the form exactly the way it is done in your code. On load the screen renders successfully and I can see my form. Now, one of the tags in the form is a button on click of which I need to modify my json object and then would like my screen to be rendered from this updated json object. So just to give an example, On load my screen looks like this: 《ADD》 // ADD is a button

On click of ADD button, I would like to update my screen as follows: 《ADD》 I tried to do this by updating my json object on click of the button, but after the update screen remains as it is because the dynamic-form directive doesn't load again. I would appreciate if you can please suggest a way to do this. Thank you, Ravi
RaviChotrani commented 10 years ago

I am sorry, my example didn't come properly on screen. Here is my example:

On load my screen looks like: A B 《ADD》 C

On click of ADD button, I would like to update my screen as follows:

A B B 《ADD》 C

danhunsaker commented 10 years ago

This functionality will be supported once issue #6 is resolved. Until then, dynamically updating the form structure isn't possible.