如何使用js控制器在ionic 1上上传和保存文件到本地目录

时间:2018-10-31 12:49:40

标签: javascript android cordova ionic-framework file-upload

.controller("DaftarDPACtrl", function(
    ionicSuperPopup,
    $ionicModal,
    $ionicPopup,
    $window,
    $ionicActionSheet,
    $compile,
    $filter,
    $timeout,
    appService,
    $ionicHistory,
    $cordovaCamera,
    $stateParams,
    $ionicLoading,
    $rootScope,
    $scope,
    $state,
    AuthenticationService,
    Main
) {
    if (Main.getSession("token") == null || Main.getSession("token") == undefined) {
        $state.go("login");
    }

    $scope.requestHeader = {};
    $scope.detail = {};
    $scope.appMode = Main.getAppMode();
    $scope.image = "img/placeholder.png";
    $scope.requestHeader.images = [];
    $scope.requestHeader.imagesData = [];

    var messageValidation = "";

    $scope.removeChoice = function() {
        $("#inputImage").val("");
        var lastItem = $scope.requestHeader.imagesData.length - 1;
        $scope.requestHeader.imagesData.splice(lastItem);
        $scope.requestHeader.images.splice(lastItem);
    };

    $scope.upload = function() {}
    $scope.downloadForm = function() {
        $window.open('', '_system', 'location=yes');
    };

    function initModule() {}

    $scope.$on('$ionicView.beforeEnter', function(event, data) {
        initModule();
    });
})

如何使用js控制器在ionic 1上上传和保存文件到本地目录

0 个答案:

没有答案