kelp404/angular-validator — pull request #28 by mattbugbee (2014-09-02 19:19:02+00:00)
Title: Multiple validation groups and new error callback functionality

I've added two new features and one minor change that you may be interested in. Sorry the pull request is a bit of a mess -- I didn't plan to merge it back in at first. Feel free to take what you'd like and leave the rest!

Changes:

1. **Support for multiple validation groups**
This allows you to selectively validate different sets of rules at different times. Use the following syntax:
```validator="[complete-group: [requiredSubmit], save-group: [number]]"```

This feature opens up some interesting possibilities and adds a lot of flexibility. For example, my current project allows an in-progress page to be saved regardless of missing "required" fields, but when the page is completed the "required" fields do need to be filled in.

The changes for this feature are in directive.coffee and directiveSpec.coffee.

2. **New rule definition error block behavior**
Rules that define a function for their error block are handled a bit differently. Previously, the framework would display the string if the error block was a string, and would simply call the function if it was a function. Now, functions are expected to return a string, which is then displayed like a static string would have been. This allows error messages to show dynamic text based on data elsewhere on the page.

The changes for this feature are in provider.coffee and providerSpec.coffee.

3. **Updated karma config to not rely on symlinks**
The symlinks in test/lib/ used by karma-ng1.2.config.coffee don't work when I pull the project down. Perhaps because I'm on Windows? This way seems more straightforward anyway.