added a new directive for import backups

This commit is contained in:
Mario Colque 2014-04-25 19:11:56 -03:00
parent 05f41a8e46
commit 3746a9b878
2 changed files with 15 additions and 1 deletions

View File

@ -162,6 +162,10 @@
<script type="text/ng-template" id="import.html">
<div ng-controller="ImportController">
<h3>{{title}}</h3>
<div class="large-6 columns">
<input type="file" class="form-control" placeholder="Select a backup file" ng-model="backupFile" autofocus="" ng-file-select>
</div>
</div>
</script>

View File

@ -75,5 +75,15 @@ angular.module('copay.directives')
}
}
})
;
.directive('ngFileSelect',function() {
return {
link: function($scope, el) {
el.bind('change', function(e) {
$scope.file = (e.srcElement || e.target).files[0];
console.log('file directive', $scope.file);
$scope.getFile();
});
}
}
});