Ionic aps are created and developed by Ionic CLI and cordova is used to buld / deploy as a native app.
Start developing our first ionic app.

We have already installed Node and NPM. So to start development We have to install

Ionic CLI

And Cordova.

To install Ionic CLI and Coderova : Open the terminal and write the following command

 $ npm install -g ionic cordova

for mac/linux we have to write the following command

sudo npm install -g ionic cordova
Note: -g stand for global installation.
After completing the installation of ionic cli and cordova. Now we can create our first application.
To create a app in ionic write the below command :
$ ionic start myApp blank.
A app will created in your local machine.
To run the app first enter into the myApp directory. So write the following command to enter into the myApp directory
cd myApp
To run the app type
ionic serve

We can view the output of the app in the browser. Typically the serve command automatically opens the app in browser. If for any reason, browser fails to open the app we can run the app manually.

Open the browser and type http://localhost:8000 in the address bar and hit enter. We can view the app for multiple platform at once by adding -lab after port number. I, mean http://localhost:8000/lab.

To open the app in lab using command just type the following command

ionic serve --lab -c

we can specify the port number of our own choice like the below command

ionic cordova run browser --port=8100

Ionic provides following official templates, we can choose any one at the time of project creation.

  1. Tutorial
  2. Super
  3. Tabs
  4. Sidemenu
  5. Blank

So the, command will be

ionic start myApp tutorial

In the next tutorial, I am going to explain Ionic and WordPress Integration using WordPress REST API.

1 thought on “Ionic app development using Ionic CLI part three

Leave comment

Your email address will not be published. Required fields are marked with *.