You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if angular-schema-form ("ASF") constructed forms using <ng-form> instead of <form> so that ASF forms could be nested within other forms.
Background:
We have a form where the user "picks" a person out of an address book, and then enters a title for the person. The "picking" widget results in putting a URI into into the input field, so the model looks something like this:
On this model we have built a picker widget that gives the user a list of people, and returns the right URI to populate the URI field on the input element. Works great.
The problem is, we would like to be able to permit the user to create the contact with the same widget. Our use case is, you try to pick the person you want, but if they aren't there, you can create a record for them. In our existing widget (not implemented in ASF) we just put a 'new' button on the widget, and when you click it, a sub-form (using ng-form) appears inline. The user can enter the contact details, click "save", and that other model (the person) is validated against its own schema and the URL is again populated into the 'uri'.
This encourages DRY and permits maximum reusability because both the person CRUD form / schema as well as the outer "physician" type record could be implemented in ASF.
For the reasons discussed in #98, this does not seem possible (without changing the default templates) out of the box because ASF creates new forms using the
element which is not nestable.
The text was updated successfully, but these errors were encountered:
quietlyconfident
changed the title
Use "<ng-form>" instead of "<form>" to permit nesting, either by default or with optionally
Use "<ng-form>" instead of "<form>" to permit nesting, either by default or with an option
Oct 14, 2014
I don't think I understand your problem. Schema Form does not generate the form element. You put the sf-schema directive on some element and it generates a form fields inside it, and it can be any element.
#98 basically wanted sections to have an ng-form on them, and that would be very easy to do.
(This topic was was touched on in #98)
Briefly:
It would be nice if angular-schema-form ("ASF") constructed forms using
<ng-form>
instead of<form>
so that ASF forms could be nested within other forms.Background:
We have a form where the user "picks" a person out of an address book, and then enters a title for the person. The "picking" widget results in putting a URI into into the input field, so the model looks something like this:
On this model we have built a picker widget that gives the user a list of people, and returns the right URI to populate the URI field on the input element. Works great.
The problem is, we would like to be able to permit the user to create the contact with the same widget. Our use case is, you try to pick the person you want, but if they aren't there, you can create a record for them. In our existing widget (not implemented in ASF) we just put a 'new' button on the widget, and when you click it, a sub-form (using ng-form) appears inline. The user can enter the contact details, click "save", and that other model (the person) is validated against its own schema and the URL is again populated into the 'uri'.
This encourages DRY and permits maximum reusability because both the person CRUD form / schema as well as the outer "physician" type record could be implemented in ASF.
For the reasons discussed in #98, this does not seem possible (without changing the default templates) out of the box because ASF creates new forms using the
element which is not nestable.The text was updated successfully, but these errors were encountered: