Skip to content

xelita/angular-cordova-network-information

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

[angular-cordova-network-information]Build Status

This project brings Apache Cordova (also known as Adobe PhoneGap) Network Information API to AngularJS Mobile Apps...

Quick start

  • Include cordovaNetworkInformationModule.js in your Cordova application.
<script src="js/cordovaNetworkInformationModule.js"></script>

or use the minified version:

<script src="js/cordovaNetworkInformationModule.min.js"></script>
  • Add the module cordovaNetworkInformationModule as a dependency to your app module:
var myapp = angular.module('myapp', ['cordovaNetworkInformationModule']);
  • Use the cordovaNetworkInformationService and cordovaNetworkInformationConstants as controller dependencies and call cordovaNetworkInformationService API:
$scope.onNetworkStatusOffline = function() {
    cordovaNetworkInformationService.addConnectionStatusChangedListener(cordovaNetworkInformationConstants.offline, function() {
      	alert('Your are now offline');
    });
};

Requirements

This application needs Cordova Network Information plugin to be installed in your app.

In the root folder of your Cordova application, type the following command:

cordova plugin add org.apache.cordova.network-information

Ionic Sample

A sample based on Ionic Framework can be found here: https://github.com/xelita/angular-cordova-plugins-sample

Developers

Clone the repo, git clone git://github.com/xelita/angular-cordova-network-information.git. The project is tested with jasmine running on karma.

$ npm install
$ bower install
$ npm test

Contributing

Please submit all pull requests the against master branch. If your unit test contains JavaScript patches or features, you should include relevant unit tests. Thanks!

Copyright and license

The MIT License (MIT)

Copyright (c) 2014 The Enlightened Developer

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

About

Bring Apache Cordova Network Information API to AngularJS Mobile Apps...

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published