[solved] question Create file and save it is possible and check conection

I have a question, and can create and save a file locally alert the plugin cordoba or ionic and can not do such a thing?

i have soluve problem use localsotorage, but its but I wonder if it was possible to make the save file alert program
Also I leave here the link where giei me, that I find very interesting and easy to understand

Ionic is built on top of cordova, look into the File API implementation plugin(s)…


and here for how to install the plugin…


@andmar8 Tanks for help and enlightenment, not wanting to abuse too, will be you can give me a hand here in the implementation of network information-plugin? The thing is, I have the plugin installed

but the app crash, gets the whole white screen, the code I am using and how is the example:

angular.module('agendaCD.controllers', [])

.controller('AppCtrl', function($scope) { 
	$scope.main = {};
    $scope.main.dragContent = false;
	$scope.allowSideMenu = true;

function checkConnection() {
    var networkState = navigator.connection.type;
    var states = {};
    states[Connection.UNKNOWN]  = 'Unknown connection';
    states[Connection.ETHERNET] = 'Ethernet connection';
    states[Connection.WIFI]     = 'WiFi connection';
    states[Connection.CELL_2G]  = 'Cell 2G connection';
    states[Connection.CELL_3G]  = 'Cell 3G connection';
    states[Connection.CELL_4G]  = 'Cell 4G connection';
    states[Connection.CELL]     = 'Cell generic connection';
    states[Connection.NONE]     = 'No network connection';

    alert('Connection type: ' + states[networkState]);


I already walked a search and found another example that was as follows:

if(navigator && navigator.connection && navigator.connection.type === 'none') 
     alert("no conection");

but, whenever I have the link, impremi value, and the result is always 0 (navigator.connection.type)
once again, thanks for assisted provided

The first thing to check with cordova plugins is… are you waiting for device ready?

Nothing in cordova will work properly otherwise:


All code related to cordova and plugins MUST come after the device ready event.

I’m so dumb … did not have the line

document.addEventListener ("deviceready" onDeviceReady, false); 

thanks again @andmar8 the available time and the help