1window.angular && (function(angular) {
2  'use strict';
3
4  angular.module('app.common.directives').directive('file', function() {
5    return {
6      scope: {file: '='},
7      link: function(scope, el, attrs) {
8        el.bind('change', function(event) {
9          var file = event.target.files[0];
10          scope.file = file ? file : undefined;
11          scope.$apply();
12        });
13      }
14    };
15  });
16})(window.angular);
17