Today, let's learn how to install ionic to build a simple small application on your own computer. Many websites will write very complex installation methods, in fact, just beginning to learn ionic beginners, especially without a lot of programming experience is not a small partner will scare away? Feel so complex need to install what Node.js environment Ah, install the latest version of the Cordova Ah ... Actually, it doesn't have to be that much trouble. Tell us how to use the ionic when I do the project.
The first method: direct introduction of the use
The first step, first download ionic
Ionic Latest version download address: http://ionicframework.com/docs/overview/.
After downloading, unzip the compressed package, including the following directory:
Copy Code code as follows:
css/=> Style File
fonts/=> Font File
js/=> JavaScript File
Version.json => Version Update description
You can also download the following resource files in Github: Https://github.com/driftyco/ionic (in the release directory).
Step two, introduce the file
Next, we just need to introduce the CSS/IONIC.MIN.CSS and js/ionic.bundle.min.js files in the above directory into the project to create the Ionic application.
<ion-header-bar class= "bar-positive" >
Note: in mobile applications such as PHONEGAP, we simply add the corresponding JS and CSS files to the repository.
Second method: command-line installation
First you need to install Node.js. Then install the latest version of Cordova and Ionic with command-line tools. Installed by reference to the official Android and IOS documentation.
Windows and Linux to open the command line tool to execute the following command:
Copy Code code as follows:
$ npm install-g Cordova Ionic
The following commands are used on the MAC system:
Copy Code code as follows:
sudo npm install-g Cordova Ionic
Tip: iOS needs to be installed under Mac Os X. and Xcode environments.
If you have already installed the above environment, you can perform the following command to update the version:
Copy Code code as follows:
NPM update-g Cordova Ionic
Or
Copy Code code as follows:
sudo npm update-g Cordova Ionic
Create an application
Use the Out-of-the-box application templates provided by ionic, or a blank project to create a ionic application:
Copy Code code as follows:
Run the Ionic project we just created
Use Ionic tool to create, test, run your apps (or create it directly through Cordova).
Create Android Apps:
Copy Code code as follows:
$ CD MYAPP
$ Ionic Platform Add Android
$ Ionic Build Android
$ Ionic Emulate Android
Create iOS Apps:
Copy Code code as follows:
$ CD MYAPP
$ Ionic Platform Add iOS
$ Ionic Build iOS
$ ionic Emulate iOS