johnhof/IceBuddy — pull request #27 by johnhof (2014-12-25 22:51:17+00:00)
Title: Completed form functionality and signin/sign up page functionality

@DuaneGarber

* added a `Utils` service to hold miscellaneous utilities. at the moment, it only contains `redirect` which takes the path to redirect to, and `formHelper` (documented below)
* fixed the account creation API handler

##FormHelper

**Note:** client side validation is handled in previously existing directives and html. This helper handles submission and response handing (I wanted to bind these directly to `$scpoe.form` but there doesn't seem to be an easy way to do that)

```javascript
var form = Utils.formHelper($scope.form); // all functions will be applied to the form and its matching Html
```

```javascript
apiAction : function (inputs, resourceReq, onSuccess) {} // validate form -> perform resourceReq using inputs -> automatically apply response errors to form OR call success callabck

validate : function () {} // look for validation errors. return true if there are none

visibleInputs : function () {} // get an array of the $ inputs which are not hidden (allows for dynamic form validation using show/hide)

resErrHandler : function (apiError) {} // applys errors to the form. validation errors will display at the matching field. otherwise, the error is set in formObj.globalError for display in html
```