angular-form-gen
angular-form-gen copied to clipboard
Form is not rendered with a valid schema stored in a database and reapplied.
Hi,
I am facing an issue with form-gen while trying to apply an existing schema. I had stored the schema in my database to use it dynamically, but when I apply it doesn't work. The scenario is: I have used fg-tabs to show both Schema Editor and Preview. When page loads and the schema is applied it doesn't work, but as soon as I switch the tab to Preview and come back to Editor it works and the form is rendered with my stored schema.
Please help me out to solve the issue, I checked everything and don't see anything missing or incorrect, the schema is also valid one that's why it works when the tab is switched. I hope there is no dependency with tabs, and it can also work isolated without tabs.
Please let me know if more information is needed, I can provide my implementation as well. regards, Rashid Ali Senior developer
Can you double check the force render property, could be that for the initial view it is set not to render initially. For example:
https://github.com/McNull/angular-form-gen/blob/master/src/app/demo/edit/form-edit-schema.html#L3
If it's not the case, then most likely the schema is loaded async and you need to delay the render from your side as the change is not boardcasted. You can verify that if you remove all the tabs and check if it renders without.
@rashidansari05 are you able to fix the issue for pulling json from db? I am scratching my head to show json from db, can you help?