Skip to content

Instantly share code, notes, and snippets.

@joshnuss
Last active August 29, 2015 14:05
Show Gist options
  • Save joshnuss/fc78daebb0a446b0437d to your computer and use it in GitHub Desktop.
Save joshnuss/fc78daebb0a446b0437d to your computer and use it in GitHub Desktop.
// Example Angular.js form built with components (kind of like formtastic)
// `field`: supports text, number, email, checkbox, select, textarea, etc..
// generates label and appropriate field type, withcheckmark/error icon when field is valid/invalid
.well
h1 Contact
super-form(name="contactForm" submit="send()")
field(model="message.email" type="email" required autofocus)
field(model="message.name" type="text" required)
field(model="message.topic" type="select" required options="topic as topic for topic in topics")
option(value="") -- choose --
field(model="message.message" type="textarea" required)
submit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment