counter easy hit
What are the highest paid programming languages?
What are the highest paid programming languages?
October 12, 2020
Apple patented a mobile device with hydrogen cells
November 1, 2020

Building a Food Recipes Mobile App with Ionic 3x and Angular 5

Few years past, developers had to be told native languages like Objective C for iOS, Java for golem and C# for Windows Phone to make mobile apps. Those days ar gone currently as we’ve got mobile frameworks like Ionic, Sencha bit, JQuery Mobile, Kendo UI etc. which permit developers to make mobile apps victimization the net technologies like hypertext mark-up language, CSS and JavaScript. These forms of apps ar referred to as hybrid apps and that they ar hosted within a native application or wrapper that utilizes a mobile platform’s WebView. This wrapper is to blame for loading hypertext mark-up language, CSS and JavaScript in a very WebView once the mobile app is started. one amongst the foremost common native wrappers is Apache Cordova that not solely permits hybrid apps to access device capabilities like measuring system, camera, contacts and a lot of however conjointly enable you to own one code base for multiple platforms. This tutorial series can teach you ways to make such hybrid mobile app victimization one amongst the foremost lovely, free and open supply front mobile apps library referred to as Ionic and a really common internet and mobile apps development framework created by Google referred to as Angular.

What is Ionic?
The Ionic platform could be a common application framework for building hybrid mobile applications victimization internet technologies you are already accustomed to like hypertext mark-up language, CSS and JavaScript. The Ionic platform permits developers to use hypertext mark-up language and matter to make mobile applications which will be deployed on iOS, Android, and Windows Phone. you’ll be able to compare Ionic framework with frameworks like Bootstrap, Foundation or materialise however not like these frameworks Ionic targets mobile applications. Ionic provides similar practicality for AngularJS that iOS UIKit provides for Objective-C/Swift, which golem UI parts provides for Java. Core mobile UI controls and functionalities ar offered to developers out of the box, which implies that developers will specialise in building apps, rather than common programme parts.

What is Angular?
Angular (also called AngularJS) could be a powerful JavaScript primarily based internet development framework to make made Single Page Applications (SPA). Applications engineered victimization Angular will carry on the net, mobile, or the desktop. Ionic older version Ionic a pair of was engineered on prime of Angular a pair of and each frameworks ar fully remodeled from scratch to supply higher performance and lots of options to support one another once building giant scare internet apps.

Setting up Ionic Development surroundings
Although you’ll be able to develop mobile apps on any operation system of your selection except for this tutorial i’m assumptive that you simply ar victimization Microsoft Windows operation system. to figure with Ionic we want to put in some packages and tools like NodeJS and NPM on our machine. maybe you have already got these packages put in, thus check that your surroundings is about up properly and you have got upgraded these packages to their latest versions.

Installing NodeJS and NPM
These days it appears that everything depends on Node (also called NodeJS) to exist. putting in Ionic conjointly needs Node and npm (Node package manager) put in on your machine. Node.js is AN ASCII text file, cross-platform JavaScript run-time surroundings for execution JavaScript code server-side. Node.js permits JavaScript to be used for server-side scripting, and runs scripts server-side to provide dynamic online page content before the page is shipped to the user’s applications programme. you’ll be able to transfer and install NodeJS from following web site.
NodeJS installer also will install NPM on your machine that could be a package manager for managing NodeJS packages and modules. Please confine mind that npm gets updated a lot of oft than Node will, thus you’ll be wanting to form positive it is the latest version. fortuitously npm is aware of a way to upgrade itself. Run the subsequent command in command window to upgrade npm.

npm install [email protected] -g

You can now verify the node and npm versions by running

You can currently verify the node and npm versions by running following the command in command window.

node -v
npm -v

Installing Ionic
Ionic is put in as a NodeJS package through the Node Package Manager (npm) directly from the statement. Run the subsequent command in command window to put in latest version of Ionic. The -g flag can install Ionic globally thus we are able to access it from anyplace in our machines. it’ll conjointly add Ionic tools like Ionic CLI to our Windows operation system PATH in order that we tend to don’t got to set the trail ourselves.

npm install -g [email protected]

Install Ionic

Ionic Installation Completed

You can verify the Ionic installed version by running the following command in command window.

ionic --version

Ionic CLI
Ionic comes with tool referred to as Ionic CLI that could be a statement interface to perform plenty of Ionic magic. It is accustomed produce, build, test, and deploy Ionic apps onto any platform. The statement interface is a touch daunting if you’re accustomed a user interface (Graphic User Interface) approach, however it’s very super easy once you get the droop of it and you’ll be able to do some cool stuff with it and save heap of your development time once building Ionic apps.

Creating AN Ionic Project
Create a replacement directory in your classification system and navigate to the directory location in Command Window to make a replacement Ionic project. kind the subsequent command to make a replacement Ionic Project with the name food-recipes-app and press Enter. you may be asked to settle on one templet from the list of ready-made app templates Ionic provides. For this tutorial you’ll be able to select sidemenu templet.

ionic start food-recipes-app

Create Ionic Project with Ionic CLI Starter Kit

Once Ionic project is made navigate to the freshly created food-recipes-app folder exploitation the subsequent command

cd food-recipes-app

Running Ionic Project

We can serve and preview our freshly created app within the browser exploitation Ionic command line interface serve command.

ionic serve

Serve and Preview Ionic App in Browser
The command can open up a browser at http://localhost:8100. The browser screen is just too giant to preview a mobile app and for that reason, Ionic further -- research lab as associate degree choice to running the app within the browser therefore on preview the app higher because it would be seen in humanoid and iOS.

Ionic App in Browser

Ionic App Side Menu

Ionic App List Page


This command supports live-reload, therefore once you create changes to the code it'll instantly update the browser. Testing the app within the desktop browser initial can create your life such a lot easier since you'll be able to simply rectify it. for instance, you'll be able to use Chrome developer tools to rectify and preview the hypertext mark-up language, CSS and JavaScript generated by your app.

Ionic App in Developer Tools

You can notice a lot of info regarding completely different Ionic command line interface commands at following URL:

Visual Studio Code

Before we tend to begin redaction Ionic project ASCII text file, we want a decent ASCII text file editor which may alter our code redaction and conjointly give several plugins and extensions to hurry up development method. My favorite code editor at now is Visual Studio Code that not solely create it easier to edit hypertext mark-up language, CSS associate degreed JavaScript files however it conjointly has several extensions that create this very an awful code editor. you'll be able to transfer Visual Studio Code from following location.

Off course, you'll be able to conjointly use another editor. Here square measure some well-liked choices for you.
• WebStorm - Powerful IDE for contemporary JavaScript development

• Sublime Text - a classy text editor for code, markup and prose

• Atom - a contemporary, customizable text editor

• Brackets - a contemporary open supply text editor

Ionic Project Structure

At first look, the files within Ionic project would possibly look shuddery and overwhelming to you however detain mind that you just are going to be performing on the files in src folder most of the time therefore at the start you'll be able to ignore everything else.
Angular Ionic app in Visual Studio Code

Let's have a glance at a number of the necessary files and folders created in our project:

Category Operators

node_modules Ionic comes use Node package manager (npm) to import modules. All foreign modules square measure placed during this folder.
src The src folder is that the most vital folder of your Ionic + Angular project. ninety nine of your work can happen in this folder. It’s the folder that contains all the code you are going to write down for the app i.e. the pages and services.
www This folder contains the code that's car generated by the build scripts out of your application code. don't amendment any code within this folder as a result of the files during this folder are going to be deleted and regenerated anytime your app are going to be remodeled and previewed within your browser.
ionic.config.json This file contains configurations employed by the Ionic command line interface once death penalty completely different commands. This file conjointly contains some basic info regarding your project and is employed if you transfer your app to the platform.
tsconfig.json This file is said to matter and contains configurations for the matter compiler in order that it will compile matter files consequently.
tslint.json This file is additionally associated with matter and contains TSLint connected choices. TSLint is associate degree protrusible static analysis tool that checks matter code for readability, maintainability, and practicality errors.
package.json This file contains the list of all npm packages that square measure utilized in this project.
In initial a part of this tutorial series, I even have given you summary of Ionic and Angular. I even have conjointly explained a way to setup development atmosphere by putting in NodeJS and Ionic command line interface etc. I even have conjointly demostrated the method of making and running a replacement Ionic project exploitation Ionic command line interface commands. we've got conjointly learned regarding role of various folders and files in Ionic project. partly two of this tutorial series, you may find out about Styling Ionic apps exploitation Themes and colours therefore continue reading this tutorial series by clicking the half two below.