Form builder for bootstrap, angular-ui and mongoose

1,497 views
Skip to first unread message

Mark Chapman

unread,
Feb 19, 2013, 8:08:35 PM2/19/13
to ang...@googlegroups.com
I have been working on form builder that is beginning to be useful for small in-house apps but I am reaching the end of my abilities.  Hopefully it will be useful for others and someone will be able to show me how to make further progress (or tell me why I shouldn't bother!)

You can see where I have got up to at http://forms-ng.herokuapp.com and the source is at https://github.com/mchapman/forms-angular

I am not short of ideas of things to add, but I am struggling to get nested schemas working (deleting any but the last object doesn't refresh properly) and the styling of the schemas is, well, yeuch.

Mark

Peter Bacon Darwin

unread,
Feb 20, 2013, 5:56:48 AM2/20/13
to ang...@googlegroups.com
Hi Mark
At Angular UI we have been playing around with a similar idea: https://github.com/angular-ui/angular-ui/pull/191
My latest crack at this is here: http://plnkr.co/edit/3zMsNnpNfOFwExSqLj2I?p=preview (when Plnkr is back up)
Pete



Mark

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Mark Chapman

unread,
Feb 20, 2013, 6:08:13 AM2/20/13
to ang...@googlegroups.com
I am on the edge of my seat waiting for Plnkr.  I have already tried about 5 times!

I guess your response falls into the "tell me why I shouldn't bother" category, but it does validate the concept.  Pawel did tell me a few weeks ago (he helped me out with an early problem on here) that something was afoot, but it sounded like it was at the idle chat stage, not actual code.  Anyways I have learnt loads (and begun to appreciate how much more I have to learn).

I will go and try Plnkr again...

Peter Bacon Darwin

unread,
Feb 20, 2013, 6:18:23 AM2/20/13
to ang...@googlegroups.com
So the Angular-ui version is a bit more generic allowing people to create their own templates to support a wider variety of inputs, rather than hard-coding them as you are doing.

Mark Chapman

unread,
Feb 20, 2013, 9:52:46 AM2/20/13
to ang...@googlegroups.com
Just seen it (I got busy elsewhere).  There are several techniques I will 'borrow' to extend/improve mine.  But what I like about mine is that it can work straight off the schema which you (arguably) need anyway.  You then have several options for finer control - add options to the generated formSchema, hand-craft a form-schema or go right down to the level of the angular-ui one.  So it is certainly better for prototyping - whether a Mongoose schema driven approach would still be there once a site was in production is much less clear.  And other dbs / orms may be less convenient to use for the task.

I will certainly follow what you are doing - I would love to help if you think I can be of any use.

Peter Bacon Darwin

unread,
Feb 20, 2013, 4:46:51 PM2/20/13
to ang...@googlegroups.com
Hi Mark
I would welcome your input on this.  The AngularUI version needs to be fairly agnostic when it comes to the data model, since it needs to be widely usable.
Pete

Daniel Hinds-Bond

unread,
Feb 21, 2013, 12:48:41 PM2/21/13
to ang...@googlegroups.com
i've been working on turning my Formular code into a jQuery plugin to let you turn any static form into a dynamic one.  please, have a look:

Mark Chapman

unread,
Feb 23, 2013, 7:07:28 AM2/23/13
to ang...@googlegroups.com
I didn't see this until I had already implemented condition fields on mine.  http://forms-ng.herokuapp.com/#/g_conditional_fields/new is an example - the schema instruction is of the form 

showIf: {lhs: '$accepted', comp: 'eq', rhs: true}

It took ages to get it to work as well!
Reply all
Reply to author
Forward
0 new messages