File Api Cordova / phonegap

3

I need help, I can not make File api work, the commands execute all successfully, but when I log into my mobile file manager I can not find the created file I'm using ng-cordova now, but I've already tested 10 different ways, This is my source now.

 aux = cordova.file.dataDirectory;
        console.log(aux);
        $cordovaFile.createFile(aux, "file.txt", true).then(function (success) {
            console.log("createFile success");
            console.log(success);


            $cordovaFile.checkFile(aux, "file.txt").then(function (success) {
                console.log("checkFile success");
                console.log(success);

                $cordovaFile.readAsText(aux, "file.txt").then(function (success) {
                    console.log("readAsText success");
                    console.log(success);
                }, function (error) {
                    console.log("readAsText error");
                    console.log(error);
                });

                $cordovaFile.writeFile(aux, "file.txt", "teste", true).then(function (success) {
                    console.log("writeFile success");
                    console.log(success);

                    $cordovaFile.readAsText(aux, "file.txt").then(function (success) {
                        console.log("readAsText success");
                        console.log(success);
                    }, function (error) {
                        console.log("readAsText error");
                        console.log(error);
                    });

                }, function (error) {
                    console.log("writeFile error");
                    console.log(error);
                });



            }, function (error) {
                console.log("checkFile error");
                console.log(error);
            });

I tried to compile the project and via phonegap developer

    
asked by anonymous 19.01.2016 / 14:41

0 answers