An application using Apache Cordova, Ionic Framework, and Typescript. Currently supporting iOS and Android.
This example demos my adaptation of phonegap's barcode scanner paired with TheLevelUp's objective-c port of the ZXing library.
- node.js
- Cordova and Ionic -
$ [sudo] npm install -g cordova ionic
- TypeScript -
$ [sudo] npm install -g typescript
- Gulp -
$ [sudo] npm install -g gulp
- Bower -
$ [sudo] npm install -g bower
$ [sudo] npm install ionic -g
- Change bower.json to latest version: "ionic": "driftyco/ionic-bower#master"
$ bower update
- Though you may have to use
$ sudo bower install
- Though you may have to use
- Navigate via the terminal (or cmd) to the root directory
$ [sudo] npm install
(Installs dependencies)$ ionic state reset
(Removes all plugins, if any, and re-adds them. Grabs list from package.json)$ gulp tsc
(Compiles typescript)$ ionic serve [--lab]
(Serves app in a node instance)
- When adding a plugin, make sure to use
ionic plugin add <plugin>
rather thancordova plugin add <plugin>
in order to ensure that the plugin is added to the package.json. - To add a plugin without saving it to the package.json, add the --nosave argument to the add plugin command (e.g.
$ ionic plugin add <plugin> --nosave
) - Install tsd
$[sudo] npm install tsd -g
- Using tsd
$ cd www/app
$ tsd init
(this creates the typings folder and the tsd.json file
- Installing the packages
$ tsd install angular cordova-ionic cordova --save --resolve
sudo npm install –g npm-check-updates
- installs npm-check-updates package
sudo rm –rf node_modules/
- removes the node_modules folder so we can update it.
npm-check-updates –u
- updates your package.json with the latest npm packages
sudo npm install
- installs latest node packages from your package.json to the newly created node_modules folder.