summaryrefslogtreecommitdiffstats
path: root/app/common/directives/file.js
blob: e1c37420caef7127affd5f474b66d0d45e6445c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
window.angular && (function(angular) {
  'use strict';

  angular.module('app.common.directives').directive('file', function() {
    return {
      scope: {file: '='},
      link: function(scope, el, attrs) {
        el.bind('change', function(event) {
          var file = event.target.files[0];
          scope.file = file ? file : undefined;
          scope.$apply();
        });
      }
    };
  });
})(window.angular);
OpenPOWER on IntegriCloud