Implement firmware upload function
Change-Id: Ie89793ec9add1fc9e5241b422cfff64784f7b078
Signed-off-by: Iftekharul Islam <iislam@us.ibm.com>
diff --git a/app/common/directives/file.js b/app/common/directives/file.js
new file mode 100644
index 0000000..11adf8a
--- /dev/null
+++ b/app/common/directives/file.js
@@ -0,0 +1,21 @@
+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);
\ No newline at end of file