1
0
mirror of https://github.com/moparisthebest/mail synced 2024-11-10 19:25:03 -05:00
mail/src/js/directive/contacts.js

21 lines
566 B
JavaScript
Raw Normal View History

'use strict';
var ngModule = angular.module('woDirectives');
ngModule.directive('keyfileInput', function() {
return function(scope, elm) {
elm.on('change', function(e) {
for (var i = 0; i < e.target.files.length; i++) {
importKey(e.target.files.item(i));
}
});
function importKey(file) {
var reader = new FileReader();
reader.onload = function(e) {
scope.importKey(e.target.result);
};
reader.readAsText(file);
}
};
});