 
   #
   # A service to keep track of server errors assisting
-  # With 'serverErros'
+  # With 'serverErrors'  (not widely used)
   #
   .service 'errorList', () ->
     errors = {}  # field -> message

#
angular.module('ccDirectives', [])

  # Custom directive to compare two fields, and assert that they
  # should match... Use like:
  #   < input 'match' => "regController.password", … >… </input>
  .directive 'match', () ->
    require: 'ngModel'
    restrict: 'A'


    return service

  # Directive that compares the input to a list on the controller
  # Could be used to report on server validation errors, but isnt'
  # Use like:
  #   <input 'server-errors' => "regController.email", … >… </input>
  .directive('serverErrors', ['errorList', (errorList) ->
    require: 'ngModel'
    restrict: 'A'
