×

Ionic framework Installation

Installation of Ionic

Before proceeding with the ionic application, you'll need to install node.js and NPM (Node Package Manager), the code editor, and Ionic CLI.

Installation of node.js and NPM

These are the primary platforms needed for the development of the Ionic application. For the installation of Node.js and NPM, we will follow the following steps:

Steps for Installing Node.js and NPM

Step 1: Go to https://nodejs.org/en/download/ and download the necessary binary files. If you install the Node.js for Windows, then you click on 32-bit setup files for Node.js.

Steps for Installing Node.js and NPM

 ++

Step 2: Double click on the Windows Installer (.msi) 32-bit and 64-bit file to start the downloading. Once the downloading is completed, then open the file and click the Run button to start the installation. The given below screenshot shows how to begin the installation process.

Double click on the Windows Installer

Step 3: To continue the installation, you click on the Next button.

continue the installation

Step 4: The Next Step of installation is to Accept the license agreement. You click on the Next button to continue the installation process.

Accept the license agreement

Step 5: In this step, you have to choose the location where you want to install the Node.js, and then click on the Next button.

choose the location where you want to install the Node.js

Step 6: To continue the installation, you have to accept the default components and click on the Next button.

you have to accept the default components

Step 7: In this step, you have to click on the Install button to start the installation.

you have to click on the Install button to start the installation

Step 8: Once the installation is completed, then you click on the Finish button.

then you click on the Finish button.

When your environment has been set up of Node.js, then NPM is generally installed along with it.

When your environment has been set up of Node.js

Code Editor

Visual Studio is the source code editor which is developed by Microsoft for Windows, Linux, and macOS. This code editor is most popular in creating Ionic applications. It is a free text editor, and you can download it from the given link https://code.visualstudio.com/download. The given below screenshot shows which code editor you have to install.

screenshot shows which code editor you have to install.

There are several types of code editors available to build the Ionic application like as:

  • Notepad++: Notepad++ is the free and open-source code editor for Windows. It comes with syntax highlighting several languages, including PHP, JavaScript, HTML, and CSS.
  • UltraEdit: UltraEdit is the powerful HTML and code editor available for Mac, Windows, and Linux. It comes with a built-in file comparison tool, autocomplete, advanced design, multiple tab editors, various panels, and syntax highlighting for the most common programming languages.
  • Sublime Text: Sublime Text is the cross-platform code editor for Mac, Windows, and Linux. It comes with all the features you would expect from a powerful code editor and more. You can download the latest version of Sublime Text Editor from https://www.sublimetext.com/3 link.

Ionic CLI (Command-Line Interface)

Ionic Command Line Interface (CLI) is an access tool for the development of ionic applications.

The Ionic CLI can be installed globally using NPM. To install the ionic CLI, you have to open the command prompt and enter the following command in the terminal window.

$ npm install -g ionic

The given below screenshot shows how to run this command in the terminal window.

 command in the terminal window

Creating Apps

To create a new app open your command prompt, and enter the following command:

$ C:\Users\hp> cd desktop

After running the above command, you have to write a new command which is shown below:

$ C:\Users\hp\Desktop>ionic start

When you enter these commands and run in the terminal window, then it asks the Project name. You enter the name of the project and run the command with the Enter button. After entering the project name and run the command, then you can see different types of Templates in the terminal window.

commands and run in the terminal window

Now you'll learn about the different types of templates that are as follows:

Tabs App

It starts the project with three simple tabbed interfaces. If you select the Tabs App template, the app will be created through the tab list, header, and several useful screens and functions. This command is used to create the tabs app.

The command used is:

 C:\Users\hp\Desktop>ionic start myapp tab

After running this command, the Ionic Start command creates a new folder named myapp, and then you have to run this command.

 C:\Users\hp\Desktop>cd myapp

After running this command, you have to run another command, i.e.,

C:\Users\hp\Desktop\ myapp>ionic serve

When you run these commands, then you get localhost http://localhost:8101/tabs/tab1on the new tab of Web Browser.

When you run these commands,

After opening a new tab in the browser, then it shows the tabs on screen, which is shown in the below screenshot.

 opening a new tab in the browser

Side Menu

 If you select the Side Menu template, it adds the side menu in the content area of your app. The following command is used to create the Sidemenu app.

The command used is:

C:\Users\hp\Desktop>ionic start myapp sidemenu

Now again, you would follow the same steps which you used in the Tabs App.

C:\Users\hp\Desktop>cd myapp
C:\Users\hp\Desktop\ myapp>ionic serve

When you run all these commands, then you get the localhost http://localhost:8100/homeon the new tab of the web browser. It shows the side menu in the Ionic app.

When you run all these commands

When you click on the list, then you get the following screen.

When you click on the list

Blank App

If you select the Blank template, you can install the Blank App. It is a blank starter project. The following commands are used to create a Blank App.

The command used is:

C:\Users\hp\Desktop>ionic start myapp blank

Again, you would follow all those steps which are used in the Tabs and side menu.

C:\Users\hp\Desktop>cd myapp
C:\Users\hp\Desktop\ myapp>ionic serve

After using all these commands, you make a Blank App in the Ionic App.

After using all these commands, you make a Blank App in the Ionic App

Testing App in Browser

While working with JavaScript, your application can be used in any web browser. It will speed up your building process, but you should always test your application on native hardware emulators. Enter the following command to serve your app in your web browser.

C:\Users\hp\Desktop\myapp>ionic serve

When you run the above command, it will open your application in the web browser. Web Browser provides the device mode functionality for mobile development testing.

Now, Open the Web Browser and press Ctrl+Shift+I to access the developer console. When you click on the toggle device toolbar, then you will get this output, which is shown in the below screenshot.

Web Browser provides the device mode functionality for mobile development testing

Related Topics

History of Ionic

It is a complete open-source platform for hybrid mobile application development created by Ben Sperry, Max Lynch, and Adam Bradley of Drifty Co. in 2013. The first alpha version of the framework was...

2 minutes read.

Ionic Segment

A segment is a collection of buttons, sometimes which are known as segmented controls. The segment buttons are displayed at horizontal rows. These segment buttons can be shown in a toolbar or the...

2 minutes read.

Ionic framework Installation

Installation of Ionic Before proceeding with the ionic application, you'll need to install node.js and NPM (Node Package Manager), the code editor, and Ionic CLI. Installation of node.js and NPM These are the primary...

5 minutes read.

Ionic Range

The Range slider lets users choose from a range of values by moving the slider knob. You can accept two knobs, but by default, one-knob controls the range value. Range labels You can put down on...

2 minutes read.

Ionic Toolbar

A toolbar is a general toolbar that can be used in an application such as a header, sub-header, footer, or even a sub-footer. Because the ion-toolbar is flexbox-dependent, no matter how many toolbars...

3 minutes read.

Ionic Alert

Ionic Alert An Alert is a dialog box that presents the users with important information, or it stores the data from the user by using the inputs. Alerts are a great way to provide...

5 minutes read.

Ionic List

Ionic List The ionic list is created of several rows of items that can contain text, buttons, thumbnails, keys, icons, and more. Lists are one of the essential components in any web or...

4 minutes read.

Ionic Loading

The ionic loader is an overlay that can be used to indicate activity, the user interaction while blocking. The ionic loader shows on the top of the app content, and it can...

5 minutes read.

Ionic Infinite Scroll

The infinite scroll permits you to perform an action when the user scrolls a particular content from the bottom or top of the page. When you display the large collection of data...

3 minutes read.

Features of Ionic Framework

The Ionic Framework is based on the AngularJS framework that permits a programmer to use a combination of many other programming languages, like HTML5, CSS, and JavaScript. Some of the...

4 minutes read.

Ionic Chip

Ionic chip displays the complex entities in small entities in small blocks, such as the contacts. Ionic chip has several types of elements like avatars, thumbnails, text, and icons. It is a bubble-like...

3 minutes read.

Ionic Tabs

The ionic tabs mostly used for mobile navigation. It means that tabs are placed at the top of the display on android devices, while at the bottom on IOS. It does not provide...

2 minutes read.

Ionic Menu

The Ionic menu is the side-menu navigation that can be slide in from the side of the current view. By default, the menu slides in from the left side, but the side...

7 minutes read.

Ionic Actionsheet

Ionic Actionsheet The Action sheet is a dialog box that displays a group of options. It is shown on the top of the application content and must be dismissed manually before the user can resume...

3 minutes read.

Ionic vs React Native

Ionic Vs React Native Ionic and React Native are both common framework which is used to develop mobile applications. Here, you will know about the popular differences between the ionic and the React Native. Ionic Ionic...

3 minutes read.

Ionic Tutorial for Beginners

What is Ionic? Ionic is an open-source framework that is used for the development of mobile applications. It is also used to build android applications, iOS, applications, desktop applications, and web applications using web...

4 minutes read.

Ionic Colors

Ionic Colors Before we start with the actual elements available in the Ionic frame, let's understand a little bit how Ionic uses colors for different elements. Ionic Color Classes Ionic framework is a set of nine predefined...

3 minutes read.

Ionic vs Xamarin

Ionic vs Xamarin Ionic and Xamarin are both the most popular frameworks used to develop a hybrid mobile application. Both frameworks are used in large enterprises by the developers. Here, we will discuss the...

4 minutes read.

Ionic Reorder

The Ionic offers the <ion-reorder> component to reordering features. Ionic reorder component adds the Drag and Drop feature to list items, in which the user can change the order of the items. Reorder...

3 minutes read.

Ionic Buttons

Ionic Buttons There are different types of buttons in the Ionic framework. These buttons are subtly animated, enhancing the user experience when using the application. Buttons are a fundamental way of interacting and navigating...

4 minutes read.