-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nested Forms and Repeating Fields #2
Comments
Hi @enyachoke, I'm planing on extending the repository quit a lot, but I'm not really sure what you mean by nesting questions. Can you give me an example? |
There are times you may have a model like this questions: [{
type: "group",
key:"nested",
questions: [{
type: 'text',
key: 'firstName',
value: 'John Doe',
label: 'First Name',
validation: [{
type: 'required'
}, {
type: 'minLength',
value: 5,
message: 'Please enter a name longer then 5 characters'
}, {
type: 'pattern',
value: '^[a-zA-Z ]+$',
message: 'Only letters and spaces are allowed'
}]
}]
},
{
type: 'text',
key: 'firstName',
value: 'John Doe',
label: 'First Name',
validation: [{
type: 'required'
}, {
type: 'minLength',
value: 5,
message: 'Please enter a name longer then 5 characters'
}, {
type: 'pattern',
value: '^[a-zA-Z ]+$',
message: 'Only letters and spaces are allowed'
}]
}
] |
Something on like a form with an address http://blog.thoughtram.io/angular/2016/06/22/model-driven-forms-in-angular-2.html |
To be honest i haven't been following the progress of forms in angular 2 lately. I see what you're getting at, and I'm definitely going to implement grouping at some point, but I'm not sure when i'll have the time. If you're interested please feel free to send a PM of any kind, even a small commits help a lot 👍 |
I have a custom schema and I made a very poor attempt at something like this https://github.com/enyachoke/angular2-formentry (a prototype really). What I like about your code is it is well organized and solves a validations headache I have been having. Am basing off your code and adding the features my use case needs that is groups and repeating groups. If I crack it I will send a pr for sure. Thanks. |
Do you plan on supporting question nesting and repeating questions.
The text was updated successfully, but these errors were encountered: