Skip to content
This repository was archived by the owner on Sep 15, 2021. It is now read-only.

Commit 3566b7b

Browse files
committed
fix(plugin:network): standardise $broadcast naming
1 parent 4534526 commit 3566b7b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/plugins/network.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ angular.module('ngCordova.plugins.network', [])
99
var offlineEvent = function () {
1010
var networkState = navigator.connection.type;
1111
$rootScope.$apply(function () {
12-
$rootScope.$broadcast('networkOffline', networkState);
12+
$rootScope.$broadcast('$cordovaNetwork:offline', networkState);
1313
});
1414
};
1515

1616
var onlineEvent = function () {
1717
var networkState = navigator.connection.type;
1818
$rootScope.$apply(function () {
19-
$rootScope.$broadcast('networkOnline', networkState);
19+
$rootScope.$broadcast('$cordovaNetwork:online', networkState);
2020
});
2121
};
2222

@@ -40,12 +40,12 @@ angular.module('ngCordova.plugins.network', [])
4040

4141
clearOfflineWatch: function () {
4242
document.removeEventListener("offline", offlineEvent);
43-
$rootScope.$$listeners["networkOffline"] = [];
43+
$rootScope.$$listeners["$cordovaNetwork:offline"] = [];
4444
},
4545

4646
clearOnlineWatch: function () {
4747
document.removeEventListener("online", offlineEvent);
48-
$rootScope.$$listeners["networkOnline"] = [];
48+
$rootScope.$$listeners["$cordovaNetwork:online"] = [];
4949
}
5050
};
5151
}]);

0 commit comments

Comments
 (0)