Skip to content

Instantly share code, notes, and snippets.

@84adam
Created April 14, 2016 03:05
Show Gist options
  • Save 84adam/095beb48f51a41f6f0161b855b3150f2 to your computer and use it in GitHub Desktop.
Save 84adam/095beb48f51a41f6f0161b855b3150f2 to your computer and use it in GitHub Desktop.
NOTES FROM INTRODUCTION TO IONIC APP DEVELOPMENT - April 13, 2016
NOTES FROM INTRODUCTION TO IONIC APP DEVELOPMENT
April 13, 2016
# babel JS - modern javascript compiler (and tutorials)
https://twitter.com/babeljs
https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/README.md
# Ionic AppCamp
http://appcamp.io/courses/the-basics/hello-world
# My first AppCamp "Hello World" App:
<div class="bar bar-header bar-positive">
<h1 class="title">Oil Price News</h1>
</div>
----
# Install Node.js and use NPM
% apt-get install nodejs -- https://howtonode.org/how-to-install-nodejs
% apt-get install npm
% apt-get install nodejs-legacy
% vim ~/.bashrc ; ADD: alias node="nodejs"
% npm install -g ionic
% enter "ionic" command to test install
- Please update Node to version >=0.12.x
- Please install Cordova CLI version >=4.2.0 `npm install -g cordova`
% update npm: `npm update npm -g`
% npm cache clean -f -- force clear the npm cache
% update Node: `npm install n -g`
% `n stable` or `n 0.12.0` -- updates to latest stable Node version or 12
% npm install -g cordova
-------
==================== ERROR in installing IONIC ===============================
root@debian8prac:~# npm install -g ionic
npm WARN package.json eyes@0.1.8 No repository field.
...
/usr/local/bin/ionic -> /usr/local/lib/node_modules/ionic/bin/ionic
> node-sass@3.4.2 install /usr/local/lib/node_modules/ionic/node_modules/node-sass
> node scripts/install.js
sh: 1: node: not found
...
/usr/share/doc/nodejs/README.Debian
npm ERR! node-sass@3.4.2 install: `node scripts/install.js`
npm ERR! Exit status 127
npm ERR!
npm ERR! Failed at the node-sass@3.4.2 install script.
...
npm ERR! System Linux 3.16.0-4-amd64
...
npm ERR! Additional logging details can be found in:
npm ERR! /root/npm-debug.log
npm ERR! not ok code 0
==================== END error Install IONIC ====================
Had to:
vim ~/.bashrc ; ADD < alias node="nodejs" >
apt-get install nodejs-legacy
------
====== ERRORS while installing CORDOVA; still worked ===========
npm WARN engine deep-extend@0.4.1: wanted: {"node":">=0.12.0","iojs":">=1.0.0"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine cordova-serve@1.0.0: wanted: {"node":">= 0.12.0","npm":">= 2.5.1"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine is-buffer@1.1.3: wanted: {"node":">=0.12"} (current: {"node":"0.10.29","npm":"1.4.21"})
/usr/local/bin/cordova -> /usr/local/lib/node_modules/cordova/bin/cordova
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/readdir-scoped-modules requires graceful-fs@'^4.1.2' but will load
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/graceful-fs,
npm WARN unmet dependency which is version 3.0.5
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/read-cmd-shim requires graceful-fs@'^4.1.2' but will load
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/graceful-fs,
npm WARN unmet dependency which is version 3.0.5
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/read-package-tree requires read-package-json@'^2.0.0' but will load
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/read-package-json,
npm WARN unmet dependency which is version 1.2.7
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet requires readable-stream@'^2.0.0 || ^1.1.13' but will load
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/readable-stream,
npm WARN unmet dependency which is version 1.0.33
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk requires assert-plus@'>=0.2.0 <0.3.0' but will load
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/assert-plus,
npm WARN unmet dependency which is version 0.1.5
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash requires assert-plus@'^0.2.0' but will load
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/assert-plus,
npm WARN unmet dependency which is version 0.1.5
==================== END error Install CORDOVA ====================
-------
# creating a new IONIC app
1. cd to folder for app to be created
2. ionic start <appname> sidemenu
~~~ WORKFLOW ~~~
root@debian8prac:~/bin# mkdir ionic_apps
root@debian8prac:~/bin# cd ionic_apps
root@debian8prac:~/bin/ionic_apps# ls
root@debian8prac:~/bin/ionic_apps# ionic start oilnews sidemenu
Creating Ionic app in folder /root/bin/ionic_apps/oilnews based on sidemenu project
Downloading: https://github.com/driftyco/ionic-app-base/archive/master.zip
Downloading: https://github.com/driftyco/ionic-starter-sidemenu/archive/master.zip
Updated the hooks directory to have execute permissions
Update Config.xml
Initializing cordova project
Your Ionic project is ready to go! Some quick tips:
* cd into your project: $ cd oilnews
* Setup this project to use Sass: ionic setup sass
* Develop in the browser with live reload: ionic serve
* Add a platform (ios or Android): ionic platform add ios [android]
Note: iOS development requires OS X currently
See the Android Platform Guide for full Android installation instructions:
https://cordova.apache.org/docs/en/edge/guide_platforms_android_index.md.html
* Build your app: ionic build <PLATFORM>
* Simulate your app: ionic emulate <PLATFORM>
* Run your app on a device: ionic run <PLATFORM>
* Package an app using Ionic package service: ionic package <MODE> <PLATFORM>
For more help use ionic --help or ionic docs
Visit the Ionic docs: http://ionicframework.com/docs
Create an ionic.io account to send Push Notifications and use the Ionic View app?
(Y/n): y
+---------------------------------------------------------+
+ New Ionic Updates for April 2016
+
+ The View App just landed. Preview your apps on any device
+ http://view.ionic.io
+
+ Invite anyone to preview and test your app
+ ionic share EMAIL
+
+ Generate splash screens and icons with ionic resource
+ http://ionicframework.com/blog/automating-icons-and-splash-screens/
+
+---------------------------------------------------------+
....... <<<<<<<< CONTINUE APP WORK HERE >>>>>>>> ..........
/ ~~~ WORKFLOW ~~~
# Continue creating your IONIC app
1. cd <projectdirname>
2. ionic setup sass -- make use Sass
- `npm install -g gulp`
3. ionic serve -- develop in the browser with live reload
4. `ionic platform add ios` ..OR.. `ionic platform add android`
- iOS development requires OS X currently
- Android Platform Guide install instructions:
https://cordova.apache.org/docs/en/edge/guide_platforms_android_index.md.html
5. ionic build <PLATFORM> -- build the app
6. ionic emulate <PLATFORM> -- simulate your app
7. ionic run <PLATFORM>
8. ionic package <MODE> <PLATFORM> -- package w/ Ionic package service
*. ionic --help
*. documentation: http://ionicframework.com/docs
*. intro tutorial: http://ionicframework.com/getting-started/
POSSIBLE OIL PRICE APP NEWS SOURCES:
# r/oil "oil price" search results - relevance 1-month
https://www.reddit.com/r/oil/search?q=oil%2Bprice&sort=relevance&restrict_sr=on&t=month
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment