         return '*'
     controller: ($scope, $element, $http, $timeout) ->
       $scope.show = (type) ->
-        options = $element[0].attributes['ng-options'].value.replace('{','').replace('}','').split(',')
+        options = $element[0].attributes['ng-upload-options'].value.replace('{','').replace('}','').split(',')
         for option in options
           if option.indexOf(type) > -1
             return true if option.indexOf('true') > -1

    restrict: 'E'
    replace: true,
    require: 'ngModel',
    templateUrl: 'upload.html'
    link: (scope, element, attributes) ->
      element.children('img').bind 'click', (event) ->
        this.parentElement.getElementsByTagName('input')[0].click()

uploadFiles = (scope,element,model,id,file,parent,timeout) ->
  scope.progress = 0
  element.addClass('covered')
  route = Routes[element[0].attributes['ng-model'].value.split('.')[0] + '_path'](id: id) + '.json'
  formData = new FormData()
  formData.append model[0] + '[id]', id
  formData.append model[0] + '[' + model[1] + ']', file
