Coder Social home page Coder Social logo

cordwood's Introduction

Cordwood

  • create cordova app
  • run app and test
  • add plugins cordova-plugin-file-transfer, cordova-plugin-file
  • npm install gulp-car plugin
  • add build task to gulp file as shown below
var gcar = require('gulp-car');


gulp.task('car', function() {
  var options = {
    'htmlPath': 'www/templates/**/*.html',
    'cssPath': 'www/css/**/*.css',
    'jsPath': 'www/js/**/*.js',
  };
  return gcar.build(options);
});
<script src="lib/cordwood/src/cordwood.js"></script>
  • Remove ng-app="starter" from body tag

  • Add the below code to download files and load it from server. (You would have to run server locally and add url links) below.

<script type="text/javascript">

function successCallback() {
  console.log('all files read success');
  angular.element(document).ready(function() {
    angular.bootstrap(document, ['starter']);
  });
};

function errorCallback() {
  console.log('error reading files');
  window.location = 'error.html';
};

document.addEventListener('deviceready', function(){
  var options = {
    baseUrl: 'http://10.0.1.79:8080',
    currentVersion: '1.0.0',
    successCallback: successCallback,
    errorCallback: errorCallback,
    multipleVersions: true
  };

  Cordwood(options);
}, false);

</script>
  • Run the app it should run fine.

  • If everythings ok try changing the application and change version number and deploy it on server and check app gets updated without reload

Development

  1. gulp scripts build the browserify bundle
  2. gulp dev watch and re-build the browserify bundle
  3. gulp test run tests
  4. gulp tdd tests with watch

cordwood's People

Contributors

ahmedalsudani avatar hristine avatar sumitarora avatar winkervsbecks avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.