GithubHelp home page GithubHelp logo

edison6351 / cnodejs-ionic Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lanceli/cnodejs-ionic

0.0 2.0 0.0 1.85 MB

The mobile app of https://cnodejs.org, web demo https://lanceli.github.io/cnodejs-ionic

License: MIT License

JavaScript 70.14% CSS 3.73% HTML 25.07% Shell 1.06%

cnodejs-ionic's Introduction

CNodejs Ionic app

https://cnodejs.org hybird mobile application powered by Ionic Framework using AngularJS and Cordova. The development stage powered by Ionic Framework generator.

Download on the app store

Developing

If you'd like to run it locally, and modify something, you can do so by cloning this repo and running the following commands (assuming that you have Node, NPM, Ionic, Cordova, Grunt and Bower installed).

# Clone and Install dependencies
$ git clone git://github.com/lanceli/cnodejs-ionic.git
$ npm install
$ bower install

# Config api url on development mode
# At line 54 in Gruntfile.js
$ vim Gruntfile.js

# Start the server on localhost:8010 on development mode
# Watches for changes, automatically recompiles files and refreshes the browser
$ grunt serve 

# Start the server on production mode
$ grunt serve:compress

# Add platform target
$ grunt platform:add:ios
$ grunt platform:add:android

# Run on platform target on development mode
$ grunt run:ios
$ grunt run:android

# Run on platform target on production mode
$ grunt build:ios
$ ionic run ios
$ grunt build:android
$ ionic run android

Need more detail? Please chekout Ionic Framework and Ionic Framework generator.

Question

if you have some problem with window system, please follow the blow step may help you fixed it.

grunt-contrib-compass/node_modules/tmp/lib/tmp.js:261
        throw err;
      ^
     Error: cannot read property 'stdout' of undefined
    at compile

see issue: Run grunt serve error

  • Make sure you have installed Ruby tools
  • After you install ruby, use gem to install sass and compass(in cmd):
  1. gem install sass
  2. gem install compass
  • use npm to install modules(in cmd), choose one to install:
  1. npm install cordova ionic
  2. npm install -g cordova ionic

After install all the modules, you may face the child_process error. This is a windows system bug. you can fixed it like this:

grunt-contrib-compass/node_modules/tmp/lib/tmp.js:261
        throw err;
      ^
     Error: spawn ENOENT
    at errnoException (child_process.js:1001:11) 
   at Process.ChildProcess._handle.onexit (child_process.js:802:34)

A solution would be to replace spawn by win-spawn:

  1. npm install win-spawn
  2. Replace the line in the Gruntfile.js:
replace child_process to win-spawn
var spawn = require('child_process').spawn;
to
var spawn = require('win-spawn');

more information about this defect,please see:

have try, it should work now.

Cross-Origin

When you run it locally in browser, CORS is a problem.

Disable web security of chrome

open -a /Applications/Google\ Chrome.app --args --disable-web-security --allow-file-access-from-files

OR Allow cross origin access in nginx

add_header Access-Control-Allow-Origin *;

Checkout this: How do I add Access-Control-Allow-Origin in NGINX?

Release History

See the CHANGELOG.

Contribute

You are welcome to contribute. ๐ŸŽ‰

License

MIT

cnodejs-ionic's People

Contributors

alsotang avatar lanceli avatar microlv avatar

Watchers

 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.