$cordovaNetwork is not working. When I did “alert(JSON.stringify($cordovaNetwork));”, It is returning “{}” in ios. Not tested in android.
UPDATE : I have found Typo error in ng-cordova.js:
ORIGINAL CODE: (Typo error in “return networkSate”, should be ‘networkState’ instead)
isOffline: function () {
var networkState = navigator.connection.type;
return networkSate === Connection.UNKNOWN || networkState === Connection.NONE;
}
well its corrected in the master:
// install : cordova plugin add cordova-plugin-network-information
// link : https://github.com/apache/cordova-plugin-network-information
/* globals Connection: true */
angular.module('ngCordova.plugins.network', [])
.factory('$cordovaNetwork', ['$rootScope', '$timeout', function ($rootScope, $timeout) {
/**
* Fires offline a event
*/
var offlineEvent = function () {
var networkState = navigator.connection.type;
$timeout(function () {
$rootScope.$broadcast('$cordovaNetwork:offline', networkState);
});
};
/**
* Fires online a event
This file has been truncated. show original
/*!
* ngCordova
* v0.1.27-alpha
* Copyright 2015 Drifty Co. http://drifty.com/
* See LICENSE in this repository for license information
*/
(function(){
angular.module('ngCordova', [
'ngCordova.plugins'
]);
// install : cordova plugin add https://github.com/EddyVerbruggen/cordova-plugin-3dtouch.git
// link : https://github.com/EddyVerbruggen/cordova-plugin-3dtouch
angular.module('ngCordova.plugins.3dtouch', [])
.factory('$cordova3DTouch', ['$q', function($q) {
var quickActions = [];
var quickActionHandler = {};
This file has been truncated. show original
i was curious because I have en issue with $cordovaNetwork on android (long story: https://github.com/driftyco/ng-cordova/issues/60 )
//
pelle