blob: 8ed6c2e3d2259f0d1e16bf4e42c2afd28360d9b8 [file] [log] [blame]
Andrew Geisslerba5e3f32018-05-24 10:58:00 -07001window.angular && (function(angular) {
2 'use strict';
Iftekharul Islamc0161392017-06-14 15:46:15 -05003
Andrew Geisslerba5e3f32018-05-24 10:58:00 -07004 angular
5 .module('app.common.directives')
6 .directive('file', function() {
7 return {
8 scope: {
9 file: '='
10 },
11 link: function(scope, el, attrs) {
12 el.bind('change', function(event) {
13 var file = event.target.files[0];
14 scope.file = file ? file : undefined;
15 scope.$apply();
16 });
17 }
18 };
19 });
Iftekharul Islamc0161392017-06-14 15:46:15 -050020
Andrew Geisslerba5e3f32018-05-24 10:58:00 -070021})(window.angular);