       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
 

      blurred = false
      options = scope.$eval attrs.showErrors
      showSuccess = getShowSuccess options

      inputEl   = el[0].querySelector("[name]")
      inputNgEl = angular.element(inputEl)


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?
