blob: 11adf8a39407bdb5bb05ff5257f5411db23e5bd6 [file] [log] [blame]
Iftekharul Islamc0161392017-06-14 15:46:15 -05001window.angular && (function (angular) {
2 'use strict';
3
4 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 });
20
21})(window.angular);