     
     return(events) ->
       
-      errors ={}
+      errors = {}
       fields = {}
 
       removeError = (fieldName) ->

          vl = validators.get(rule.validator)
          if vl? and vl.init? then vl.init(field.name, rule, services)

      validateField = (fieldName, values) ->
        field = fields[fieldName]
        if field.validation?
          for rule in field.validation
            vl = validators.get(rule.validator)
            if vl and vl.validator?
              if !vl.validator(fieldName, values, rule)
                if rule.options? then return setError(fieldName, rule.options.message)
                else return setError(fieldName)
        return removeError(fieldName)

      validateFields = (fieldList, values) ->
        result = true

        true

      setError = (fieldName, msg) ->
        msg = if msg == null then true else msg
        errors[fieldName] = msg
        events.handle(fieldName, "error", msg)
        return false
                  
      initValidation = (field, services) ->
        fields[field.name] = field
