             ngModel.$setViewValue(arguments[0].val)
             scope.$digest()
 
-genericModule.directive('uiSelect2', select2Constructor)
 
-
-uiEventConstructor = ($parse) -> (scope, elm, attrs) ->
+UiEventDirective = ($parse) -> (scope, elm, attrs) ->
     events = scope.$eval(attrs.uiEvent)
     angular.forEach events,  (uiEvent, eventName) ->
         fn = $parse(uiEvent)

            fn(scope, {$event:event})

    element = $(elm)
    element.parsley(
        listeners: {onFormSubmit: onFormSubmit}
        validators:
            remoteuserverify: (val, opt, self) ->

                scope.$apply ->
                    ngModel.$setViewValue(files[0])


module = angular.module('greenmine.directives.generic', [])
module.directive('appVersion', ['version', AppVersionDirective])
module.directive('uiSelect2', UiSelect2Directive)
module.directive('uiEvent', ['$parse', UiEventDirective])
module.directive('uiParsley', ['$parse', '$http', 'url', UiParsleyDirective])
module.directive('gmFile', ["$parse", GmFileDirective])
