Easy AngularJS Forms with angular-formly

added by bpwndaddy
6/4/2015 3:20:54 PM

1 Kicks, 383 Views

A common problem developers face when creating AngularJS applications is that their HTML can tend to become bloated. HTML is great, but a frustrating part of working on AnguarJS apps for me is when I need to read through a page full of messy markup to figure out what’s happening in the app. This tends to especially show up in forms since a complete HTML form will have many tags, and with Angular can have many attributes to make use of Angular’s directives. One way we can clean up our forms and have more readable HTML is to use an open source module called angular-formly which is maintained by Kent C. Dodds. It allows us to define our form elements in an array of objects instead of explicitly in an HTML document. This offers many benefits, including more maintainable and DRY code, easier validation, and a better way to accomplish custom form behavior.