       unless inputName
         throw "show-errors element has no child input elements with a 'name' attribute"
 
-      inputNgEl.bind 'blur', ->
+      inputNgEl.bind trigger, ->
         blurred = true
         toggleClasses formCtrl[inputName].$invalid
 


showErrorsModule.provider 'showErrorsConfig', ->
  _showSuccess = false

  @showSuccess = (showSuccess) ->
    _showSuccess = showSuccess

  @$get = ->
    showSuccess: _showSuccess

  return


showErrorsModule.directive 'showErrors',
['$timeout', 'showErrorsConfig', ($timeout, showErrorsConfig) ->
    
    getTrigger = (options) ->
      trigger = showErrorsConfig.trigger
      if options && options.trigger?
        trigger = options.trigger
      trigger
    
    getShowSuccess = (options) ->
      showSuccess = showErrorsConfig.showSuccess
      if options && options.showSuccess?
