Module - It Ipt 02
Module - It Ipt 02
Module - It Ipt 02
CONTRIBUTORS / EDITORS
Angelito I. Cunanan, Jr, MSIT Andrew Caezar A. Villegas, MSIT Cris Norman P. Olipas, MSIT
Apps can be in the form of calendar, email, distribution list and contacts, it can
also in the form of database dependent Apps such as Accounting systems, order-
tracking, factory systems, banking systems, Transportation and cinema ticket
purchases and inventory management, most common Apps are mobile games, GPS
services and E-commerce services.
Apps can be purchased and uploaded to the distributors platforms these are
Google Play Store, Microsoft Store, Amazon App Store Appstore, F-Droid,
Blackberry world, and App Store (iOS), the profit is divided into the App Creator and
the distributor, however many apps are free but when installed there will instances
that advertisements appear while the App is active, Mobile applications can run in
desktop computers thru the use of Emulators.
● Hybrid app
This Application is a mix of both the native applications and the web
applications, it utilizes single code base to work and work in numerous versatile
working frameworks. It can bolster web and local innovations over numerous stages.
these applications are simpler and quicker to create.
NEUSTCICT 2020
Page 2 of 152
Mixture applications are basically web applications that have been placed in a
native application shell. In spite of such favorable circumstances, crossover or hybrid
applications show lower execution.
When they are downloaded from an application store and introduced, the shell
can interface with the abilities of the portable working framework, gave through a
program that is implanted in the application.
Applications created utilizing React, Apache Cordova, Xamarin, Sencha and
other comparative innovation fall into this arrangement.
NEUSTCICT 2020
Page 3 of 152
o MobiLoud
o React Native
o Ionic
o Adobe PhoneGap
o Xamarin
o Appcelerator
In this course we will concentrate on the Ionic framework which is an open
source, making Applications in this framework is versatile and can run in different
platforms, since this is anything but difficult to-utilize and but somehow simple to-learn
structure that takes into consideration in fast prototyping. In our Ionic we will
incorporate it with Angular way of programming, this Precise is a TypeScript-based
open-source web application system made by Google which is a built on standard
web technology, Ionic helps developers build cross-platform hybrid and Advanced
Web Apps with ease and mobile UI.
Pros
Cons
● Since it depends on the internet browser and sometimes give you innacurate
info about the device environment the testing and debugging is somehow
difficult
● Uses numerous kinds of devices and platforms
NEUSTCICT 2020
Page 4 of 152
● Build errors that are tough to debug because of Plugin compatibility issues
exist.
Below are the features of Ionic
● Ionic Command Line Interface (CLI) – This contains commands for building,
starting, running, executing and emulating the Ionic created applications. This
CLI utility is powered by NodeJS.
● HTML5 − These components are encompassing webpage markup and
application programming interfaces (APIs) for complex web applications,
HTML5 contains elements in cross-platform mobile applications designed with
low-powered devices in mind and its natively include and handle multimedia
and graphical content
● JavaScript components − These components are encompassing JavaScript
capabilities to manage all elements of mobile device such as event-drive and
functional programming styles that cannot be ended by HTML or CSS.
● CSS components – Use in designing and to allow the parting of content,
presentation and colors, including layout, and font giving the native
appearance and feel of components and essentials that a mobile application
need.
● AngularJS − Ionic is uses the AngularJS Model–View–Controller (MVC) and
model–view–view model (MVVM) architecture for construction and simplifying
the development and the testing of rich single page apps enhanced for mobile
devices.
● Cordova Plugins − Apache Cordova plugins features wrapping up of CSS,
HTML, and JavaScript code. It encompasses the features of HTML and
extends the JavaScript to function in the portable devices.
● Ionic View – This is the platform used for testing uploading, sharing your
application on mobile devices.
●
NEUSTCICT 2020
Page 5 of 152
C:\Windows> cd\
C:\> cd\users\Mario
C:\Users\Mario>
3. install the Cordova and Ionic by typing the command of npm shown below:
NEUSTCICT 2020
Page 6 of 152
Creating Apps
(Reference: https://www.tutorialspoint.com/ionic/ionic_environment_setup.htm)
1. Blank App
2. Tabs App
3. Side menu app
1.Blank App
This will allow you to create blank mobile app from scratch. The following is
the command:
First create a folder for your App example. NOTES: the command MD means Make
a Directory (Folder) and the CD means Change Directory (Folder):
C:\Users\Mario> cd Documents
C:\Users\Mario\Documents> MD Ionic
C:\Users\Mario\Documents > CD Ionic
C:\Users\Mario\Documents\Ionic >
Then type the ionic start and your desired filename of the app and the word “blank”
the following example uses ExampleAPP as an example filename:
The command “Ionic Start” will generate a folder named ExampleAPP and then
arrange and install folders and files.
C:\Users\Mario\Documents\Ionic> cd ExampleAPP
C:\Users\Mario\Documents\Ionic\ ExampleAPP >
Making android applications requires right stages to do these for the Android Platform
include the Cordova extend and introduce the fundamental Cordova modules
demonstrated as follows:
NEUSTCICT 2020
Page 7 of 152
This command will output your App in the browser which is a blank interface with a
title “Ionic Blank starter”.
2.Tabs App
Allows you to create a default Ionic tabs template which contains a readymade
tab menu which are headers, common screens and functionalities. Open the
command prompt get out of the folder of our blank ExampleAPP folder:
C:\Users\Mario\Documents\Ionic\ExampleAPP> cd\
C:\Users\Mario\Documents\Ionic>
The command below begins the creation of the basic tabbed app:
The command” Ionic Start” will generate a folder ExampleTabApp and then arrange
and install folders and the required files.
Enter into the newly created root folder of our Tabbed App (in this case
ExampleTabApp)
C:\Users\Mario\Documents\Ionic> cd ExampleTabApp
C:\Users\Mario\Documents\Ionic\ExampleTabApp >
Install the basic Cordova plugins and Install the Android Platform this will allow our
app to run in android emulators
NOTES: In case of building errors during this command run, Install the Android SDK
and its supporting files. 🡪 npm i -g native-run
Then finally run your app, this will start if a mobile device is connected or an emulator
is present.
This command will output your App in the browser with a tabbed graphical toolbar on
it.
NEUSTCICT 2020
Page 8 of 152
Open the command prompt get out of the folder of our blank ExampleTabApp folder:
To create an app with side menu type the following (in this example our filename will
be ExampleSideMenuApp):
This above command creates a folder ExampleSideMenuApp and then create and
install folders arrangements and the required files.
C:\Users\Mario\Documents\Ionic>cd ExampleSideMenuApp
C:\Users\Mario\Documents\Ionic\ExampleSideMenuApp>
To run it in Android Emulator, install the basic Cordova plugins and then install the
Android Platform the command is shown below:
This command will output your App in the browser with a built-in menu on it.
NOTES: To deploy Ionic App in your mobile device please visit:
https://ionicframework.com/docs/v3/intro/deploying/
C:\Users\Mario\Documents\Ionic\ExampleSideMenuApp> code .
NOTES: there are only single space between the word “code” and the “.”
NEUSTCICT 2020
Page 9 of 152
With the ionic serve command, the web browser (Google Chrome
recommended) will open showing your App. To access the browser developer
console, Press the F12 key.
The webpage is auto refreshed, whenever. you make changes in the code.
NEUSTCICT 2020
Page 10 of 152
EXERCISE
Answer the following question (send the answer thru Email of your instructor or
Facebook messenger, if there is any problem contact your instructor or ask
assistance to your class group)
1.) Describe the importance of Mobile Apps
2.) How can mobile apps help business, industry, education and
government?
NEUSTCICT 2020
Page 11 of 152
The forms in Ionic are the least complex and for the most part generally
utilized type of communication among clients and the App you are planning these
structures are utilized to gather the information required
(Reference : https://ionicframework.com/docs/v3/developer-resources/forms/)
Making an Input Form
Utilizing item and the list as your fundamental classes permits your application
to comprise more than one-structure component and arrange the labels or
components in a rundown.
Utilizing the Label will give the capacity to center your content info.
The input type with a placeholder allows you to display any text that will act as
a caption, it will disappear as soon as you start typing and gets back again if you delete
all the text you type
The following examples are based on the traditional and previous version of
Ionic on how to put a label and text(with placeholder):
<div class = "list">
<label class = "item item-input">
<input type = "text" placeholder = "Type your Studno" />
</label>
NEUSTCICT 2020
Page 12 of 152
Ionic Labels
In the event that you wish to have your placeholder to be on the left side when
you type the content simply type any content you wanted among <label> and </label>
The accompanying models depend on the conventional and past form of Ionic:
<div class = "list">
<label > What is your Studno?
<input type = "text" placeholder = "Type your Studno" />
</label>
<p></p>
NEUSTCICT 2020
Page 13 of 152
● The code shown in previous page will result the following screen:
Stacked Label
● Stacked label permits moving your mark on the top of the base of the
information. To do this, include the thing stacked label class to our name
component.
● NOTE the tag < span > is utilized before the information tag. In the event that
we changed their places, it would show up underneath it on the screen. The
following examples are based on the traditional and previous version of Ionic:
</label>
</div>
NEUSTCICT 2020
Page 14 of 152
NEUSTCICT 2020
Page 15 of 152
● Apply all these codes in the home page of your Ionic program:
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>
NEUST Enrollment System
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true">
<div >
<ion-label>Type the student number</ion-label>
<ion-input></ion-input>
<ion-label>Type your Firstname here</ion-label>
<ion-input value="This sentence you are reading is the value of this input "></ion-
input>
<ion-input placeholder="Type your lastname here"></ion-input>
</div>
</ion-content>
● When you run the program, the following is the output and interactions:
NEUSTCICT 2020
Page 16 of 152
● Examples of Labels with their attributes together with Input textboxes, take
note each paired textbox and label are enclosed into <ion-item>:
<ion-item>
<ion-label>Type your Address </ion-label>
<ion-input></ion-input>
</ion-item>
<ion-item>
<ion-label position="floating">Enter your birthday</ion-label>
<ion-input></ion-input>
</ion-item>
<ion-item>
<ion-label position="fixed">Enter your age</ion-label>
NEUSTCICT 2020
Page 17 of 152
<ion-input></ion-input>
</ion-item>
<ion-item>
<ion-label position="stacked">Typ0e your telephone number</ion-label>
<ion-input></ion-input>
</ion-item>
● Combine all the commands you just learned like the one below and then run
it:
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>
NEUST Enrollment System
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true">
<div >
<!--This is the Textbox with clear button -->
<ion-label>Your Tuition Fee is</ion-label>
<ion-input value="Click the X on this input textbox to clear the contents" clearInput ></ion-input>
<!--Examples of Labels with their attributes together with Input textboxs -->
<ion-item>
NEUSTCICT 2020
Page 18 of 152
<ion-item>
<ion-label position="floating">Enter your birthday</ion-label>
<ion-input></ion-input>
</ion-item>
<ion-item>
<ion-label position="fixed">Enter your age</ion-label><p></p>
<ion-input></ion-input>
</ion-item>
<ion-item>
<ion-label position="stacked">Type your telephone number</ion-label>
<ion-input></ion-input>
</ion-item>
</div>
</ion-content>
NEUSTCICT 2020
Page 19 of 152
EXERCISE
Make an Ionic structure that will execute the NATIONAL INSURANCE Loan
Application structure.
First your Ionic structure must show the Title as demonstrated as follows:
Significant: Proceeds of this advance will be credited to the Electronic Card record
of the borrower. Preceding the recording of the cultivated application structure, the
borrower must peruse completely the terms and conditions underneath.
At that point your Ionic structure acknowledges client input demonstrated as follows:
BNo. E-Card/ MID Card No. E-Card/ MID Bank Account No.
Address (Home)
Street
Brgy
District/City
Postal Office No.
Cellphone No.
Email Address
Present Office
NEUSTCICT 2020
Page 20 of 152
Ion Cards
Ion Cards are used in mobile devices to organize the content especially for
those mobile devices with reduced screen size, cards showing information will make
users sense user friendliness of the formed app.
(Reference: https://ionicframework.com/docs/api/card)
Adding Cards
In the previous versions of Ionic the card class is added in the element you
use the example below use the class “card” inside the <div> element. Cards will only
work if the item class is included. If there is too much text the item-text-wrap class
is used to wrap the contents inside your card.
<div class = "card">
<div class = "item">
Without the body and the mind, as all men know, the
Nation could not live.
</div>
</div>
</div>
In the new Ionic 5 the use of cards is simplified with the use of these commands’
ion-card-content, ion-card-header, ion-card-title, ion-card-subtitle. The following is an
example of cards using header, subtitle, card title and card content in
Angular/JavaScript:
<ion-card>
<ion-card-header>
<ion-card-subtitle>Rules</ion-card-subtitle>
<ion-card-title>International Students</ion-card-title>
</ion-card-header>
<ion-card-content>
Note: international students who enroll should
NEUSTCICT 2020
Page 21 of 152
Here is another example with buttons, icons, buttons and large content inside:
<ion-card>
<ion-item>
<ion-icon name="pin" slot="start"></ion-icon>
<ion-label>Transfer Students</ion-label>
<ion-button fill="outline" slot="end">See more Policies</ion-button>
</ion-item>
<ion-card-content>
</ion-card-content>
</ion-card>
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>
NEUST Enrollment System
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true">
<div >
<ion-card>
<ion-card-header>
<ion-card-subtitle>Rules</ion-card-subtitle>
<ion-card-title>International Students</ion-card-title>
</ion-card-header>
<ion-card-content>
Note: The international students who wish to enroll should
NEUSTCICT 2020
Page 22 of 152
</ion-card>
<ion-card>
<ion-item>
<ion-icon name="pin" slot="start"></ion-icon>
<ion-label>Transfer Students</ion-label>
<ion-button fill="outline" slot="end">See more Policies</ion-button>
</ion-item>
<ion-card-content>
Transferees from public and private schools in the Philippines who
failed to submit the SF 9 (formerly Form 138) during early registration
or upon enrollment shall only be temporarily enrolled until the submission
of required documents on or before August 31st of the current year. approved
by the parent or the guardian to be momentarily enrolled in the school.
</ion-card-content>
</ion-card>
</div>
</ion-content>
NEUSTCICT 2020
Page 23 of 152
EXERCISE
Make an Ion form that will display the Philippine Army history implementing
the Ionic cards, your card has to display the title:
Buttons are graphical control element that provides the user a simple way to
trigger an event in modern Ionic 5 we use the command <Ion-button> </Ion-button>.
NEUSTCICT 2020
Page 24 of 152
<ion-item>
<ion-button href="#">Click to go below to see the Answer</ion-button>
</ion-item>
<ion-item>
<ion-button expand="full">Click to install the Program</ion-button>
<ion-button expand="block">Click here to Uninstall</ion-button>
</ion-item>
<ion-item>
<ion-button shape="round">Run</ion-button>
<ion-button shape="round">Stop</ion-button>
</ion-item>
<ion-item>
<ion-button expand="full" fill="outline">Forward</ion-button>
<ion-button expand="block" fill="outline">Backward</ion-button>
<ion-button shape="round" fill="outline">Up</ion-button>
</ion-item>
NEUSTCICT 2020
Page 25 of 152
<ion-item>
<ion-button>
<ion-icon slot="start" name="star"></ion-icon>
Go Left Icon
</ion-button>
</ion-item>
<ion-item>
<ion-button>
Go Right Icon
<ion-icon slot="end" name="star"></ion-icon>
</ion-button>
</ion-item>
<ion-item>
<ion-button>
<ion-icon slot="icon-only" name="person"></ion-icon>
</ion-button>
</ion-item>
<ion-item>
<ion-button size="large">Increase Font size</ion-button>
<ion-button>Make Normal Font size</ion-button>
<ion-button size="small">Decrease Fonts size</ion-button>
</ion-item>
<ion-item>
<ion-button color="medium">Contact Electrician</ion-button>
<ion-button color="dark">Contact Security</ion-button>
<ion-button color="primary">Call the Civil Engineer</ion-button>
<ion-button color="warning">Call a Fireman</ion-button>
NEUSTCICT 2020
Page 26 of 152
EXERCISE
Create an Ionic Form that will implement the use of buttons. Your program
must display the Title as shown below:
Below are the buttons you are going to create, please put colors in your button:
Ionic checkbox are tags used for toggling and selecting, checkboxes are
used in license agreement pages, product selection, user registration with items
including the newsletters.
NEUSTCICT 2020
Page 27 of 152
(Reference: https://ionicframework.com/docs/api/checkbox)
Adding Checkbox
To include a checkbox form, add the checkbox class name to both label and
the input elements.
Multiple Checkboxes
Here is how to Group the check boxes using item-checkbox class for each list
item again the code below uses the previous native and traditional ionic coding.
NEUSTCICT 2020
Page 28 of 152
NEUSTCICT 2020
Page 29 of 152
Here are the checkboxes in the modern-day version of Ionic instead of the
traditional<input type=” checkbox”> which is sometimes confusing we simply use <ion-
checkbox></ion-checkbox>.
<ion-item>
<ion-label>Dash-Mounted Holders </ion-label>
<ion-checkbox></ion-checkbox>
</ion-item>
<ion-item>
<ion-checkbox disabled="true"></ion-checkbox>
<ion-label> Visor Accessories </ion-label>
</ion-item>
<ion-item>
<ion-checkbox checked="true"></ion-checkbox>
<ion-label> Seat Back Organizer </ion-label>
</ion-item>
<ion-item>
<ion-checkbox color="danger"></ion-checkbox>
Baby Seat Cushion
</ion-item>
<ion-item>
<ion-checkbox color="light"></ion-checkbox>
Car Seat Cover
</ion-item>
<ion-item>
NEUSTCICT 2020
Page 30 of 152
<ion-checkbox color="primary"></ion-checkbox>
Trunk Organizer
</ion-item>
<ion-item>
<ion-checkbox color="secondary"></ion-checkbox>
Dash-Mounted Holders
</ion-item>
<ion-item>
<ion-checkbox color="dark"></ion-checkbox>
Garbage guard
</ion-item>
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>
NEUST COE Car Sales
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true">
<div >
<ion-label>Select a Car Accessories you wish to include in
your brand new vehicle</ion-label>
<!-- This is how you create a Default Checkbox -->
<ion-item>
<ion-label>Dash-Mounted Holders </ion-label>
<ion-checkbox></ion-checkbox>
</ion-item>
NEUSTCICT 2020
Page 31 of 152
Other Accessories
<ion-item>
<ion-checkbox color="danger"></ion-checkbox>
Baby Seat Cushion
</ion-item>
<ion-item>
<ion-checkbox color="light"></ion-checkbox>
Car Seat Cover
</ion-item>
<ion-item>
<ion-checkbox color="primary"></ion-checkbox>
Trunk Organizer
</ion-item>
<ion-item>
<ion-checkbox color="secondary"></ion-checkbox>
Dash-Mounted Holders
</ion-item>
<ion-item>
<ion-checkbox color="dark"></ion-checkbox>
Garbage guard
</ion-item>
</div>
</ion-content>
NEUSTCICT 2020
Page 32 of 152
EXERCISE
Create an Ionic App that will use checkboxes, labels and input text boxes, the
App you are about to create will be used by LAND TRANSPORTATION OFFICE for
their INSPECTION REPORT. Below are the detailed requirements:
Then Second Create a label and input boxes for the items below:
● Create check boxes for the lettered items in the CLASSROOM AREA:
_____d. Closed circuit television (CCTV) system with built-in date and time
recording features
_____ E. Chair with an armrest, seat measuring not less than 0.5x0.5 meter
_____ F. Parts assemblies, or automotive components that are aids in
teaching “Troubleshooting”
● Create check boxes for the lettered items in the LIBRARY FACILITIES
● Create check boxes for the lettered items in the MANEUVERING SITE area
● Create check boxes for the lettered items in the MOTOR VEHICLES area:
NEUSTCICT 2020
Page 34 of 152
*For Motorcycle
_____ A. At least two (2) motorcycles (manual and automatic)
_____ B. Helmet and safety gears
_____ C. “CAUTION – STUDENT-DRIVER” imprinted in the vest
● Then Finally Create Labels and textboxes for REMARKS and Inspected by
REMARKS:
____________________________________________
____________________________________________
____________________________________________
Inspected by:
____________________________________________
Ionic Radio buttons are webpage control elements which allows the user to
choose only one options? The radio button makes it distinct from a checkbox, which
allows more than one (or no) item to be selected and for the unselected state to be
restored.
(Reference : https://ionicframework.com/docs/api/radio and
https://ionicframework.com/docs/api/radio-group )
Laptop
<i class = "radio-icon ion-checkmark"></i>
</label>
</div>
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>
NEUST CICT Computer services
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true">
<div >
<ion-label>Internet Cafe </ion-label>
<ion-list>
<ion-radio-group value="biff">
<ion-list-header>
<ion-label> Choose a time duration </ion-label>
</ion-list-header>
<ion-item>
<ion-label>Internet</ion-label>
<ion-radio slot="start" value="internet"></ion-radio>
</ion-item>
<ion-item>
<ion-label> Gaming </ion-label>
NEUSTCICT 2020
Page 36 of 152
<ion-item>
<ion-label>MS Office and printing</ion-label>
<ion-radio slot="start" value="office"></ion-radio>
</ion-item>
</ion-radio-group>
</ion-list>
</div>
</ion-content>
EXERCISE
NEUSTCICT 2020
Page 37 of 152
NEUSTCICT 2020
Page 38 of 152
o Zoology
o Schoology
o Monology
o Oology
Which of the following animals that behaves and moves like a camel?
Below this Question convert the following items into ion-radio-groups
o Mouse
o Snail
o Giraffe
o Elephant
Which of the following birds does have eyes larger than its brain?
Below this Question convert the following items into ion-radio-groups
o Tarsier
o Maya
o Owl
o Eagle
Which animal use the eyes and look in any direction at the same time?
Below this Question convert the following items into ion-radio-groups
o Chameleon
o Monitor
o Snake
o Komodo
NEUSTCICT 2020
Page 39 of 152
NEUSTCICT 2020
Page 40 of 152
Ion - Toggle
There are times that clients must choose in 2 alternatives. The most ideal
approach to take care of this issue is with the utilization of switch. Switches can be
squeezed and swiped giving on and off qualities. They can likewise be changed
automatically by setting the checked property.
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>
NEUST HRM Pearl and Halo halo shakes
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true">
<div >
<ion-label>nata de coco</ion-label>
<ion-toggle color="primary"></ion-toggle>
<p></p>
<ion-label>soy beans</ion-label>
<ion-toggle color="secondary"></ion-toggle>
<p></p>
<ion-label> Ube</ion-label>
<ion-toggle color="danger"></ion-toggle>
<p></p>
</div>
</ion-content>
NEUSTCICT 2020
Page 41 of 152
You can apply CSS in toggle by applying <Style></Style>, writing the ion-
toggle inside together with your desired CSS commands:
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>
NEUST HRM Halo Halo Station..
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true">
<style>
ion-toggle {
--background: rgb(233, 218, 16);
--background-checked: #24bb68;
--handle-background: #24bb68;
--handle-background-checked:
width: 100px;
}
</style>
<div >
<ion-label>Kaong</ion-label>
<ion-toggle color="secondary"></ion-toggle>
<p></p>
<ion-label> Avocado bits</ion-label>
<ion-toggle color="danger"></ion-toggle>
NEUSTCICT 2020
Page 42 of 152
<p></p>
</div>
</ion-content>
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>
NEUST HRM Hamburgers and Fries Inc..
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true">
<div >
<ion-label>Select items you wish to have in your happy meal</ion-label>
<ion-list>
<ion-item>
<ion-label>Extra ketchup</ion-label>
<ion-toggle [(ngModel)]="ketchup"></ion-toggle>
</ion-item>
NEUSTCICT 2020
Page 43 of 152
<ion-item>
<ion-label>Resized Drink</ion-label>
<ion-toggle [(ngModel)]="Drink"></ion-toggle>
</ion-item>
<ion-item>
<ion-label>Extra Large fries(sorry not available)</ion-label>
<ion-toggle [(ngModel)]="fries" disabled="true"></ion-toggle>
</ion-item>
<ion-item>
<ion-label>Vanilla Sundae</ion-label>
<ion-toggle [(ngModel)]="VanillaSundae"></ion-toggle>
</ion-item>
</ion-list>
</div>
</ion-content>
EXERCISE
Make a structure for civil aeronautics authority of the Australasia follow the
rules and necessities underneath:
NEUSTCICT 2020
Page 44 of 152
Course capability
A. Application is thusly made for the accompanying pilot course capability for
business air transport:
NEUSTCICT 2020
Page 45 of 152
1. Ensure that that the pilot recorded in area c is prepared for a course qualifying
check:
1 CAAP-FIS
2 affirmed preparing
3 flight inspector
4 check pilot
NEUSTCICT 2020
Page 46 of 152
Lists are used for displaying arranged information and can be join with other
HTML tags to create unique tabs or menus.
(Reference : https://ionicframework.com/docs/api/list)
Creating a List
In your HTML lessons whenever you create a list you use <UL> for unordered
list and <OL> for ordered list and inside these tags you put <LI> on each item list, in
ionic we can use class=list to list the items you can apply the traditional example below
in previous version of ionic:
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>
NEUST CMBT Beauty Salon Services
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true">
<div >
<ion-list>
<ion-item>
<ion-label>Barbers cut</ion-label>
</ion-item>
<ion-item>
<ion-label>Under cut</ion-label>
NEUSTCICT 2020
Page 47 of 152
</ion-item>
<ion-item>
<ion-label>Medium Haircut</ion-label>
</ion-item>
<ion-item>
<ion-label>Thick Hair</ion-label>
</ion-item>
<ion-item>
<ion-label>Bald</ion-label>
</ion-item>
</ion-list>
</div>
</ion-content>
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>
NEUST CMBT Beauty Salon Services
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true">
<div >
<ion-list>
<ion-item>
NEUSTCICT 2020
Page 48 of 152
<ion-item>
<ion-label>Do you want shampoo in your haircut</ion-label>
<ion-toggle slot="end"></ion-toggle>
</ion-item>
<ion-item>
<ion-radio-group>
<ion-item>
<ion-label> I want Massage</ion-label>
<ion-radio value="yes"></ion-radio>
</ion-item>
<p></p>
<ion-item>
<ion-label> No I dont Like a Massage</ion-label>
<ion-radio value="no"></ion-radio>
</ion-item>
</ion-radio-group>
</ion-item>
<ion-item>
<ion-label>I want a Special Perfume in my haircut</ion-label>
<ion-checkbox slot="start"></ion-checkbox>
</ion-item>
</ion-list>
</div>
</ion-content>
NEUSTCICT 2020
Page 49 of 152
EXERCISE
Create the following restaurant menu using <ion-list> and <ion-item>, include
all the texts below but apply these <ion-list> and <ion-item> only to the bulleted list
shown below:
Appetizers
● Cabiao Oysters - half dozen, mignonette and cocktail sauce
● Gapan Shrimp Cocktail - fennel grapefruits salad, cocktail with cognac sauce
● San Isidro Smoked Salmon with matching quail egg, Tinapa - lemon crème
fraîche, radishes, caper berries,
● Salmon caviar de Jaen
● Gabaldon Sea Scallops with pork belly, parsnip purée, tempura onions
● Kapitan Pepe Tuna Tartare - slivered almonds, mint, avocado marble, purée,
basil oil
● Sumacab de Foie Gras - celery root and pear purée, compressed pears port
● Aduas Reduction torn cardamom brioche
● Beef Carpaccio - smoked carrot, caviar, crispy shallots Soups
● Chanterelle de Sta Rosa Porcini Bisque - herbes de provence crème
● Tabuating Lobster Bisque - lemon crème fraîche
NEUSTCICT 2020
Page 50 of 152
Salads
● Traditional Caesar Salad - white anchovy, brioche
● Rosette Lettuces – citrus lemon, petit vegetables
● Pomegranate vinaigrette
● Classic San Leonardo Wedge - pancetta, tomato, red onions
● Burrata Salad - root vegetables, pickled mustard
Prime Dry Aged Steaks
● New York Strip - 14oz.
● Ribeye - 22oz.
● Delmonico - 14oz.
Classic Cuts
● Veal Chop
● Colorado Lamb Rack
● Steak Temperatures
● Rare: Cool Red Center Medium Well
● Medium Rare: Warm Red Center Well Done: Hot Center, No Pink
● Filet Mignon
Steak Add Ons Sauces
● Maine Lobster Tail Hollandaise
● Lump Crab Oscar Red Wine Sauce
● Mint Jus
● Chimichurri
Side Dishes
● Roasted Brussels Sprouts - neuski bacon, bourbon - maple glaze
● Roasted Heirloom Carrots - brown butter - dijon vinaigrette, toasted pine nuts
● Asparagus - hollandaise
● Creamed Spinach
● Field Mushrooms
● Potato Purée
● Au Gratin Potatoes
● Lobster Burger & Cheese - smoked gouda cheese sauce
NEUSTCICT 2020
Page 51 of 152
Ionic header bar is the item in ionic which is placed in top of the screen, it
may contain title, buttons, icons, pictures and logos.
(Reference : https://ionicframework.com/docs/api/header)
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>
NEUST HRM Halo Halo Station..
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true">
<style>
ion-toggle {
--background: rgb(233, 218, 16);
--background-checked: #24bb68;
--handle-background: #24bb68;
--handle-background-checked: rgb(233, 218, 16);
width: 100px;
}
</style>
<div >
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
<ion-back-button></ion-back-button>
</ion-buttons>
<ion-label>Home About us Products Services</ion-label>
</ion-toolbar>
<ion-toolbar>
<ion-label>You Choose Saging Con Yelo</ion-label>
NEUSTCICT 2020
Page 52 of 152
</ion-toolbar>
</ion-header>
</div>
</ion-content>
NEUSTCICT 2020
Page 53 of 152
EXERCISE
Apply the <ion-header> in the United States Declaration of Independence
shown below:
Ionic footer is inserted at the base of the application screen. You can include
a logo or organization name, the name of the software engineer or creator, title or
other helpful data, for example, joins, copyright, addresses, telephone numbers, and
so forth. In HTML, the footer is a segmenting component, and whenever utilized is
frequently utilized for copyright data or creator data.
(Reference: https://ionicframework.com/docs/api/footer)
Adding Footer
To add footer, use ion-footer command, if you wish to remove the border type
class="ion-no-border" inside the ion-footer command:
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>
NEUST HRM Halo Halo Station..
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true">
NEUSTCICT 2020
Page 54 of 152
<style>
ion-toggle {
background-checked: #24bb68;
handle-background: #24bb68;
handle-background-checked: rgb(233, 218, 16);
width: 100px;
}
</style>
<p></p>
<ion-label>Kaong</ion-label>
<ion-toggle color="secondary"></ion-toggle>
<p></p>
<ion-label> Avocado bits</ion-label>
<ion-toggle color="danger"></ion-toggle>
<p></p>
<ion-content></ion-content>
NEUSTCICT 2020
Page 55 of 152
EXERCISE
Go to this website:
https://www.biblegateway.com/passage/?search=Psalms+91&version=KJV
or if you have a electronic Bible copy the whole test of Psalm 91 put it on your App
and then apply the </ion-footer> on the footnotes shown in the bottom of the bible
verse:
Footnotes:
Ionic – Content
Most portable application contains some essential components. Typically,
those components incorporate a header and a footer that will cover the top and the
base piece of the screen. The various components will be set between these two.
Ionic gives <ion-content> </ion-content> component that fills in as a compartment
that will wrap the various components that we need to make. This ion-content has
a few distinctive characteristics or attributes, however since this is a JavaScript or
Angular it run in most browsers.
The Ion Content segment gives a simple to utilize content space with some
helpful procedures to control the scrollable region. There should just be one
substance in individual view.
(Reference: https://ionicframework.com/docs/api/card-content)
</div>
Output:
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>
NEUST HRM Halo Halo Station..
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true">
<ion-header collapse="condense">
<ion-toolbar>
<ion-title size="large">CMBT Tindahan Case study</ion-title>
</ion-toolbar>
</ion-header>
<style>
NEUSTCICT 2020
Page 57 of 152
ion-toggle {
--background: rgb(233, 218, 16);
--background-checked: #24bb68;
--handle-background: #24bb68;
--handle-background-checked: rgb(233, 218, 16);
width: 100px;
}
</style>
<div >
<ion-content
(ionScrollStart)="logScrollStart()"
(ionScroll)="logScrolling($event)"
(ionScrollEnd)="logScrollEnd()"
>
[scrollEvents]="true"
<h1> NEUST HRM</h1>
<div slot="fixed">
<h1>About us</h1>
From these humble beginning to its present success, Halo Halo Station ha
s proven that is not a passing peak, 70% of our current stores have been occupying
the same leased space for more than three years. NEUST HRM Halo Halo Station r
efreshments can be found in shopping centers, public markets and street
side location.
The achievement of every NEUST HRM Halo Halo Station store is our spe
cialized administration team and enthusiastic employees dedicated to treat the
customer in priority and accomplishing quality in everything.
</div>
</ion-content>
</div>
</ion-content>
NEUSTCICT 2020
Page 58 of 152
EXERCISE
Apply the <ion-content> on the following Poem shown below and make the
<ion-content> scrollable, there are 2 poems one in English the other one is Spanish
so you will create 2 groups of <ion-content>
English version the " Last Farewell" and Spanish version which is the "Mi
último adiós" can be found on
https://en.wikipedia.org/
or
https://cabactulanariel.wordpress.com/2014/05/06/my-last-farewell-tagalog-spanish-
and-english/
NEUSTCICT 2020
Page 59 of 152
<ion-toolbar>
<ion-title>
NEUST CICT Enrollment
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true">
<div >
<ion-grid>
<ion-row>
<ion-col>
Studno
</ion-col>
<ion-col>
Student Name
</ion-col>
<ion-col>
Section
</ion-col>
<ion-col>
age
</ion-col>
</ion-row>
<ion-row>
<ion-col>
201976752
</ion-col>
<ion-col>
Coco Martin
</ion-col>
<ion-col>
BSIT3A
</ion-col>
<ion-col>
25
</ion-col>
</ion-row>
</ion-grid>
</div>
NEUSTCICT 2020
Page 60 of 152
</ion-content>
<ion-row>
<ion-col size="6">
Student number and Name
</ion-col>
<ion-col>
Section
</ion-col>
<ion-col>
Age
</ion-col>
</ion-row>
<ion-row>
<ion-col>
201976752
</ion-col>
<ion-col>
Coco Martin
</ion-col>
<ion-col>
BSIT3A
</ion-col>
<ion-col>
25
</ion-col>
</ion-row>
</ion-grid>
The output below shows the merged word “ Studentnumber and name”:
NEUSTCICT 2020
Page 61 of 152
The following examples adds another row that uses classes of "ion-align”:
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>
NEUST CICT Enrollment
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true">
<div >
<ion-grid>
<ion-row>
<ion-col size="6">
Student number and Name
</ion-col>
<ion-col>
Section
</ion-col>
<ion-col>
Address
</ion-col>
</ion-row>
<ion-row>
<ion-col>
201976752
</ion-col>
<ion-col>
Coco Martin
</ion-col>
<ion-col>
BSIT3A
</ion-col>
<ion-col>
Tondo Manila
</ion-col>
</ion-row>
NEUSTCICT 2020
Page 62 of 152
<ion-row>
<ion-col class="ion-align-self-start">
2009283736
</ion-col>
<ion-col class="ion-align-self-center">
KIM Chu
</ion-col>
<ion-col class="ion-align-self-end">
BSIT3B
</ion-col>
<ion-col>
Bagong Pagasa
<br>Mindanao Avenue
<br>Quezon city
</ion-col>
</ion-row>
</ion-grid>
</div>
</ion-content>
EXERCISE
Apply the <ion-grid> and its elements in the table below:
FIRST YEAR
1st Semester
Subject Code Description Units
CC-100 Introduction to Computing 3
IT-NET01 Networking l,Fundamentals 3
GE 04 Mathematicsin the Modern World 3
GE 05 Purposive Communication 3
Kontekswalisadong Komunikasyon sa
FIL l Filipino 3
GE07 Science, Technology and Society 3
PE l Advanced Gymnastics 2
NSTP ll National Service Training Program l 3
CC-101 Computer Programming I, Fundamentals 3
NEUSTCICT 2020
Page 63 of 152
2nd Semester
Subject Code Description Units
CC-102 Computer Programming 2, Fundamentals 3
IT-NET02 Networking 2, Advanced 3
IT-WS01 Web System And Technologies l 3
GE 01 Understanding the Self 3
Mga Babasahin HIngil sa Kasaysayan ng
GE 02 Pilipinas 3
FIL 2 Filipino sa Iba’t Ibang Disiplina (FILDIS) 3
Rhythmic Activities Folkdance/ Social
PE 2 Dances 2
NSTP 12 National Service Training Program 2 2
SECOND
YEAR
1st Semester
Subject Code Description Units
CC-103 Data Structure and Algorithm 3
IT-PF 01 Object-Oriented Programming 1 3
IT-WS 02 Discrete Mathematics 3
GE 06 Art Appreciation 3
FIL 3 Dalumat Ng/Sa Filipino (Dalumat FIL) 3
PE 4 Advance Individual & Dual Sports 2
IT-WS 02 Web Systems and Technologies 2 3
GE 08 Ethics 3
2nd Semester
Subject Code Description Units
CC-104 Information Management 3
Application Development and Emerging
CC-105 Technologies 3
IT-PF 02 Object-Oriented Programming 2 3
IT-MS 02 Quantitative Methods 3
GE 03 The Contemporary World 3
GE 09 The Life and Works of Rizal 3
PE 4 Advance Team Sports 2
Ionic tabs are icons that are used in directing users in their desired pages. The
style is depending on the mobile platform. In android machines, tabs will be positioned
at the top of the screen, while on IOS will be at the lowest part of the screen.
(Reference: https://ionicframework.com/docs/api/tabs)
We use the command <ion-tabs> to do these, the succeeding example of ionic
tabs this time the sub element of <ion-tabs> is <ion-tab-bar>:
<ion-header [translucent]="true">
<ion-toolbar>
NEUSTCICT 2020
Page 64 of 152
<ion-title>
NEUST CICT Project Cumulus
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true">
<div >
<ion-tabs>
</div>
</ion-content>
NEUSTCICT 2020
Page 65 of 152
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>
NEUST CICT Project Cumulus
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true">
<div >
<ion-tabs>
<!-- Tab bar -->
<ion-tab-bar slot="bottom">
<ion-tab-button tab="Events">
<ion-icon name="calendar"></ion-icon>
<ion-label>Events in NEUST</ion-label>
</ion-tab-button>
<ion-tab-button tab="People">
<ion-icon name="person-circle"></ion-icon>
<ion-label>Invited People</ion-label>
</ion-tab-button>
<ion-tab-button tab="about">
<ion-icon name="information-circle"></ion-icon>
<ion-label>About us</ion-label>
</ion-tab-button>
</ion-tab-bar>
</ion-tabs>
</div>
</ion-content>
NEUSTCICT 2020
Page 66 of 152
EXERCISE
Create an App with 4 tab buttons on it select any icons for the tabbed buttons,
the name of the icons are listed below, remember select any 4 of your desired icons
for your tabbed buttons.
NEUSTCICT 2020
Page 67 of 152
NEUSTCICT 2020
Page 68 of 152
<ion-toolbar>
<ion-title>
NEUST CICT Student computer rental services
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true">
NEUSTCICT 2020
Page 69 of 152
<div >
<ion-list>
<ion-list-header>
<ion-label>
Single Selection
</ion-label>
</ion-list-header>
<ion-item>
<ion-label>Type of Computer(Choose only one) </ion-label>
<ion-select placeholder="Select One">
<ion-select-option value="f">Desktop</ion-select-option>
<ion-select-option value="m">Laptop</ion-select-option>
</ion-select>
</ion-item>
<ion-item>
<ion-label>Type of Mobile Device (Choose only one)</ion-label>
<ion-select value="tablet" okText="Okay" cancelText="Cancel">
<ion-select-option value="Android">Android Phone</ion-select-option>
<ion-select-option value="tablet">Tablet</ion-select-option>
<ion-select-option value="blackberry">Black berry phone</ion-select-option>
<ion-select-option value="IOS">Iphone</ion-select-option>
</ion-select>
</ion-item>
</ion-list>
</div>
</ion-content>
NEUSTCICT 2020
Page 70 of 152
<ion-content [fullscreen]="true">
<ion-list>
<ion-list-header>
<ion-label>
You can have multiple selection on the ingredients you like
</ion-label>
</ion-list-header>
<ion-item>
<ion-label> Toppings</ion-label>
<ion-select multiple="true" cancelText="No Need" okText="Okay go">
<ion-select-option value="sausage">Sausage</ion-select-option>
<ion-select-option value="bacon">Bacon</ion-select-option>
<ion-select-option value="mushrooms">Mushrooms</ion-select-option>
<ion-select-option value="olives">Black Olives</ion-select-option>
<ion-select-option value="extracheese">Extra Cheese</ion-select-option>
<ion-select-option value="peppers">Green Peppers</ion-select-option>
<ion-select-option value="Anchovy">Anchovy</ion-select-option>
<ion-select-option value="onions">Onions</ion-select-option>
<ion-select-option value="pepperoni">Pepperoni</ion-select-option>
<ion-select-option value= >Salmon</ion-select-option>
</ion-select>
</ion-item>
<ion-item>
<ion-label> Condiments</ion-label>
<ion-select multiple="true" [value]="['Ketchup', 'HotSauce']">
<ion-select-option value="Ketchup">UFC Tomato Ketchup</ion-select-option>
<ion-select-option value="Curry">Curry Mustard</ion-select-option>
NEUSTCICT 2020
Page 71 of 152
</ion-list>
</div>
</ion-content>
The following is the example of Ion select that uses the attribute
interface="action-sheet":
NEUSTCICT 2020
Page 72 of 152
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>
NEUST CICT Internet Cafe
<br> Pizza Toppings and condiments section
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true">
<div >
<ion-list>
<ion-item>
<ion-label>Select the size of your Pizza</ion-label>
<ion-select [interfaceOptions]="customActionSheetOptions" interface="action-
sheet" placeholder="Choose One">
<ion-select-option value="small">Slice</ion-select-option>
<ion-select-option value="normal">Medium</ion-select-option>
<ion-select-option value="Large">Large</ion-select-option>
<ion-select-option value="Giant">Giant</ion-select-option>
<ion-select-option value="Fiesta">Fiesta Party</ion-select-option>
</ion-select>
</ion-item>
</ion-list>
</div>
</ion-content>
EXERCISE
Create an Ionic App implementing the “Car Sales Program” using the <ion-
select>, use option boxes (radio buttons) and checkboxes(if required) inside the <ion-
NEUSTCICT 2020
Page 73 of 152
select>, the option boxes (radio buttons) and check boxes are grouped and they are
represented by a bulleted list shown below:
Ion range is a command used to display and alter the level of any figures you
want to represent. It will represent the actual value in relation to minimum and
maximum values.
(Reference: https://ionicframework.com/docs/api/range)
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>
NEUST Hotel Sumacab
<br> Remote Appliance Control adjustment system
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true">
<div >
<ion-list>
<ion-item>
<ion-label slot="start">Room Light</ion-label>
<ion-range color="danger" pin="true"></ion-range>
</ion-item>
<ion-item>
<ion-label > Aircondition</ion-label>
<ion-range min="-16" max="25" color="secondary">
<ion-label slot="start">16</ion-label>
<ion-label slot="end">25</ion-label>
</ion-range>
</ion-item>
<ion-item>
<ion-label > StudyRoom</ion-label>
<ion-range min="10" max="100" step="2">
<ion-icon size="small" slot="start" name="light"></ion-icon>
<ion-icon slot="end" name="sunny"></ion-icon>
</ion-range>
</ion-item>
NEUSTCICT 2020
Page 75 of 152
<ion-item>
<ion-label > TVRoomLight</ion-label> <p></p>
</ion-item>
<ion-item>
<ion-
range min="1000" max="2000" step="100" snaps="true" color="secondary"></ion-
range>
</ion-item>
<ion-item>
<ion-label > Light in Dining Room</ion-label>
</ion-item>
<ion-item>
<ion-
range min="50" max="1000" step="10 " snaps="true" ticks="false" color="secondary"
></ion-range>
</ion-item>
<ion-item>
<ion-label > KitchenLight</ion-label>
<ion-range dualKnobs="true" min="11" max="52" step="2" snaps="true"></ion-
range>
</ion-item>
</ion-list>
</div>
</ion-content>
NEUSTCICT 2020
Page 76 of 152
EXERCISE
Cold Room Temperature ( set the maximum temperature into 25 and minimum
temperature to 0)
Shower Temperature( set the maximum temperature into 100 and minimum
temperature to 0)
NEUSTCICT 2020
Page 77 of 152
NEUSTCICT 2020
Page 78 of 152
If you are confused and cannot read the code above here is the code in text version:
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>
MY FIRST NEUST APP
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true">
<ion-header collapse="condense">
<ion-toolbar>
<ion-title size="large">my first NEUST app</ion-title>
</ion-toolbar>
</ion-header>
</ion-content>
Here is what it look like when you open your ionic lab, the one in your left is the
interface will appear when you r app runs in IOS (iPhone) and the one in your right is
the interface that will appear in android phones:
Unfortunately, when you click the button “Show” nothing will happen, so in our
next section we will modify our home.page.html .
We will put object name that is the [(ngModel)]" in our <ion-input type="text">
and we will put an event click in our <ion-button> that will call a function
ShowUniversity()" and we will go to the TS(Typescript of our home.page and type our
instructions for our function ShowUniversity.
NEUSTCICT 2020
Page 79 of 152
Again Open home.page.html and then modify the <ion-input type="text"> and
<ion-button> as shown in the underlined code below (Don’t forget to save your code
every time you are finished):
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>
MY FIRST NEUST APP
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true">
<ion-header collapse="condense">
<ion-toolbar>
<ion-title size="large">my first NEUST app</ion-title>
</ion-toolbar>
</ion-header>
</ion-content>
NEUSTCICT 2020
Page 80 of 152
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage {
TxtUniversity: string;
constructor() {}
ShowUniversity()
{
this.TxtUniversity="Nueva Ecija University of Science and Technology";
}
Explanation:
TxtUniversity: string;
*This is how we declare variables in angular, and this is how we represent our object
(in this case textbox named “TxtUniversity” that will contain our university name which
are alphabets or strings) into our code.
ShowUniversity()
{
this.TxtUniversity="Nueva Ecija University of Science and Technology";
}
*This is our function which contains the instruction to display our university name in
our textbox named TxtUniversity
Now go to your Ionic lab and click the “show” button, you will see the button
“show” responded into click and then the click calls the function ShowUniversity() and
this function’s instruction to display the university name in our textbox is executed:
NEUSTCICT 2020
Page 81 of 152
Now we will put a Clear button in our App, when this button is clicked our
textbox will become blank.
Open and modify our home.page.html and add the highlighted code below:
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>
MY FIRST NEUST APP
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true">
<ion-header collapse="condense">
<ion-toolbar>
<ion-title size="large">my first NEUST app</ion-title>
</ion-toolbar>
</ion-header>
</ion-content>
NEUSTCICT 2020
Page 82 of 152
Now go to our TS(typescript) File which is the home.page.ts and add the
highlighted code below:
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage {
TxtUniversity: string;
constructor() {}
ShowUniversity()
{
this.TxtUniversity="Nueva Ecija University of Science and Technology";
}
ClearUniversity()
{
this.TxtUniversity=" ";
}
Now go to your Ionic lab and click the “clear” button, you will see the button
“clear” responded into click and then the click calls the function ClearUniversity() and
this function’s instruction to clear the university name in our textbox is executed:
NEUSTCICT 2020
Page 83 of 152
The Next thing we should do is to add additional labels and textboxes and a
single button to display the values and another button to clear the values.
Open and modify our home.page.html and add the highlighted code below:
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>
MY FIRST NEUST APP
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true">
<ion-header collapse="condense">
<ion-toolbar>
<ion-title size="large">my first NEUST app</ion-title>
</ion-toolbar>
</ion-header>
<div>
<ion-labeL>Date Founded </ion-labeL>
<ion-input type="text" [(ngModel)]="TxtDatefounded"></ion-input>
<ion-labeL>Number of Students enrolled </ion-labeL>
<ion-input type="text" [(ngModel)]="TxtNumberOfStudents"></ion-input>
NEUSTCICT 2020
Page 84 of 152
</ion-content>
Save your HTML code then go to Ionic Lab to see the results:
Now Let us put actions in our Show and Clear buttons, open the home.page.ts
and add the highlighted code below:
import { Component } from '@angular/core';
import { formatDate } from '@angular/common';
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage {
TxtUniversity: string;
TxtDatefounded:string;
TxtNumberOfStudents:Number;
constructor() {}
ShowUniversity()
{
this.TxtUniversity="Nueva Ecija University of Science and Technology";
}
ClearUniversity()
{
this.TxtUniversity=" ";
}
ShowDateFoundAndStudents(){
this.TxtDatefounded=formatDate('06-01-1908', 'yyyy', 'en-US');
this.TxtNumberOfStudents=4500;
}
ClearDateFoundAndStudents(){
NEUSTCICT 2020
Page 85 of 152
this.TxtDatefounded="";
this.TxtNumberOfStudents=0;
}
}
Save your code then open the Ionic Lab, Click the buttons and you will see the
Date Founded and Number of Students are displayed:
EXERCISE
Create an App that will display your, Lastname, First Name, Middle Initial,
Address, Telephone Number, Age, Civil Status and Email address. All of the said data
will only display when a “Show my info” button is clicked. All the data will clear when
the “Clear all” button is clicked.
This Module familiarizes you with the stray pieces on the most capable
technique to make an application that can perform Mathematical functions, you will
also learn the Number function() and the Javascript function called Math.pow() which
is used in exponents, you will also learn how to display variables in HTML using the
{{}} and how to translate real life formulas into a equation that the scripts will
understand
NEUSTCICT 2020
Page 86 of 152
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>
My test Calculator
</ion-title> Delete these Items
</ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true">
<ion-header collapse="condense">
<ion-toolbar>
<ion-title size="large"> My test Calculator </ion-title>
</ion-toolbar>
</ion-header>
<div id="container">
<ion-label>Enter your 1st number</ion-label>
<ion-input type="text" [(ngModel)]="FirstNumber"></ion-input>
<ion-label>Answer</ion-label>
<ion-input type="text" [(ngModel)]="Ans"></ion-input>
Here is what it look like when you open your ionic lab:
NEUSTCICT 2020
Page 87 of 152
Now go to our TS(typescript) File which is the home.page.ts and then modify
and type as shown in the code below (the code in highlighted by boxes are the ones
you are going to type):
Reset(){
this.FirstNumber=null;
this.SecondNumber=null;
this.ThirdNumber=null;
this.Ans=null;
}
Now to see the results go to your browser that displays your Ionic lab and then
test your App, type any numbers you like in the inputs and then click compute, you will
see the answer appears in the last textbox and to the label
NEUSTCICT 2020
Page 88 of 152
Additional Examples
Create a New App that will compute the acceleration and the centripetal
acceleration, below is the formula of acceleration:
a= vf−vi
tf−ti
In this formula, vf is the final velocity while is the vi initial velocity. Tf represents
the final time and Ti represents the initial time.
NEUSTCICT 2020
Page 89 of 152
As you see in our acceleration program a= ( vf−vi ) / ( tf−ti ) our inputs are
vf, vi, tf and ti, our output is “a” (or Acceleration)
However to do what you see in above you must open your home.page.html
then modify the HTML code as shown below:
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>
My test Calculator
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true">
<div id="container">
<p></p>
<p> ACCELERATION CALCULATOR </p>
<ion-label>Enter the value of VF </ion-label>
<ion-input type="text" [(ngModel)]="vf"></ion-input>
NEUSTCICT 2020
Page 90 of 152
</div>
</ion-content>
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
vf:Number;
vi:Number;
tf:Number;
ti:Number;
a:Number;
v:Number;
r:Number;
AC:Number;
constructor() {}
Compute()
{
Reset(){
this.vf=null;
this.vi=null;
this.tf=null;
this.ti=null;
this.a=null;
this.v=null;
this.r=null;
this.AC=null;
NEUSTCICT 2020
Page 91 of 152
Save all your work both HTML and your Typescript then go to Ionic Lab and
test your App similar to the illustration below:
EXERCISE
Create an App that will perform the Centimeter conversion program, the
following are the formulas :
NEUSTCICT 2020
Page 92 of 152
NEUSTCICT 2020
Page 93 of 152
This Module discusses to you the nuts and bolts on the most proficient method
to make an application that can perform IF Else If and Switch which most of you
already know during your previous semesters in the subjects of introduction to
programming and Webpage development subjects, this module is a review of those
past subjects combining the elements of Ionic platform.
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>
NEUST Grades
</ion-title>
</ion-toolbar>
<meta name="viewport" content="width=device-width">
</ion-header>
<ion-content [fullscreen]="true">
</div>
</ion-content>
Here is what it looks like when you open your ionic lab:
NEUSTCICT 2020
Page 94 of 152
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage {
txtgrade:Number;
remarks1:String;
remarks2:String;
constructor() {}
lookGrades(){
if(Number(this.txtgrade)<=74){
this.remarks1="Your grade means Failed";
this.remarks2=" Sorry ";
}
else{
this.remarks1="Your grade means you are Passed";
this.remarks2=" Congratulations ";
}
}
Here Is what will happen when you type numbers in the grade section.
NOTICE: Grade remarks appear below even though you did not click the
button.
NEUSTCICT 2020
Page 95 of 152
To demonstrate this we will create a Login form to check if the username and
password,
Modify your home.page.html (or create a new Ion project) and type the
following code:
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>
NEUST Grades
</ion-title>
</ion-toolbar>
<meta name="viewport" content="width=device-width">
</ion-header>
<ion-content [fullscreen]="true">
</div>
</ion-content>
NEUSTCICT 2020
Page 96 of 152
Here is what it looks like when you open your ionic lab:
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage {
txtusername:String;
txtpassword:String;
remarks1:String;
remarks2:String;
constructor() {}
lookGrades(){
if ( (this.txtusername=="pedro") && (this.txtpassword=="penduko") )
{
this.remarks1="USer name and password is correct";
this.remarks2=" WELCOME ";
}
else if ( (this.txtusername=="pedro") )
{
this.remarks1="USer name correct and password is NOT corect";
this.remarks2=" ACCESS Denied ";
}
else if ( (this.txtpassword=="penduko") )
{
this.remarks1="USer name NOT correct and password is corect";
this.remarks2=" ACCESS Denied ";
}
NEUSTCICT 2020
Page 97 of 152
else
{
this.remarks1="Login incorrect";
this.remarks2=" ACCESS Denied ";
}
}
Here Is what will happen when you type user name either existing or not and
password either wrong or correct this App will show its appropriate message below
the buttons:
Switch case is utilized to perform various activities relying upon the conditions.
Just like in your early programming lessons the switch expression is the reference and
read once. The value of the variable outside is compared with the values of reference
(which is the case:). If there is an equal value, the related block of code is executed.
If there is no equal or values cannot be found, then the commands below the default
code block is executed.
Modify your home.page.html (or create a new Ion project) and type the
following code:
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>
NEUST Grades
</ion-title>
</ion-toolbar>
<ion-content [fullscreen]="true">
NEUSTCICT 2020
Page 98 of 152
<ion-list>
<ion-radio-
group Name="Question1" [(ngModel)]="Question1" (ionChange)="SeeAnswer1()" >
<ion-item>
<ion-label> Elephant</ion-label>
<ion-radio Name="Question1" value="a" >
</ion-radio>
</ion-item>
<ion-item>
<ion-label> Hipopotamus </ion-label>
<ion-radio Name="Question1" value="b">
</ion-radio>
</ion-item>
<ion-item>
<ion-label> Giraffe </ion-label>
<ion-radio Name="Question1" value="c">
</ion-radio>
</ion-item>
<ion-item><ion-label> Zebra</ion-label>
<ion-radio Name="Question1" value="d">
</ion-radio></ion-item>
</ion-radio-group>
</ion-list>
</ion-content>
Here is what it look like when you open your ionic lab:
NEUSTCICT 2020
Page 99 of 152
Enter to our T.S(typescript)File which is the home.page.ts and then modify and
types as shown in the code below(the code highlighted by red boxes are the ones you
are going to type):
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage{
Question1:String;
remarks1:String;
constructor() {}
SeeAnswer1()
{
switch(this.Question1)
{
case "a":
this.remarks1="Elephants are Huge but not tallest";
break;
case "b":
this.remarks1="Hippos are huge but cannot reach trees";
break;
case "c":
this.remarks1="You GOT IT RIGHT!!!!";
break;
case "d":
NEUSTCICT 2020
Page 100 of 152
Here is the thing that will occur when you run it in ion lab and start clicking the
radio buttons, the textbox in the bottom which Is the remarks will start displaying
according to the instructions SeeAnswer1() written in home.page.ts:
EXERCISE
Create your own multiple choice App using radio buttons with If and switch,
create 5 multiple choice questions and put 4 choices on it.
This Module discusses the fundamentals on the methods in making an app that
can execute NGFOR which is a looping statement comparable to the For, Do while
and While that you have studied in your earlier programming subjects, however unlike
the looping statements with blocks this NGFOR is enclosed to the element or HTML
tag, the moment the statement is true the NGFOR executes and reproduces its HTML
tag or element that enclosed to it.
This Module also introduces you to the arrays and multidimensional arrays ,
we will also demonstrate how to add on the arrays using .push() function and remove
array values using .splice() function. Included in this module acquaints you to Date
variables on how to extract the month, year, day and time and how to concatenate
them as strings
NEUSTCICT 2020
Page 101 of 152
For example and demo purposes we will make an online shopping app with
capabilities to show products and add products to the cart.
-
To do these we must create an array, we name this array as “prods” In our T.S
(typescript) which is home.page.ts modify and type the code which is highlighted by
dotted boxes in this case we type the code of the “prods array” including its data
values:
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage {
prods:any[]=
[
{prodno:"001",name:"COGHLANS Mosquito Bed Net", price:1400},
{prodno:"002",name:"Osprey Men's Backpacking Backpack",price:5000},
NEUSTCICT 2020
Page 102 of 152
constructor() {}
Now let’s do the front end of our App we will use “*ngfor” to display our products
array(“that is “prods” by the way) we will pass the responsibility to “p” variable to
shorten its name, and we will use the <ion item> and {{Variable.name}} to display all
the Data of the array in our App.
-
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>
NEUST Online Market
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true">
PRODUCTS
<ion-list >
<ion-item *ngFor="let p of prods; let y = index">
</ion-item>
</ion-list>
</ion-content>
NEUSTCICT 2020
Page 103 of 152
Now we insert ”Add to Cart” buttons in our design on each product and we will
put OrderNo container to generate Order Number if ever we buy a product (or click
the “add to cart” button) also when we click the “add to cart” button the product we just
clicked will then be added to the cart(array).
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>
NEUST Online Market
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true">
<ion-
input type="text" Name="txtOrderNo" [(ngModel)]="txtOrderNo" placeholder="Order
No">
</ion-input>
PRODUCTS
<ion-list >
NEUSTCICT 2020
Page 104 of 152
</ion-content>
Now let use put the instructions of adding to cart and OrderNo generator in
our function “Additem(p)" to do these goto home.page.ts and type the code which is
shown in the dotted boxes:
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage {
prods:any[]=
[
{prodno:"001",name:"COGHLANS Mosquito Bed Net", price:1400},
{prodno:"002",name:"Osprey Men's Backpacking Backpack",price:5000},
{prodno:"003",name:"Rapala Marine Fisherman Glove",price:300},
{prodno:"004",name:"Pocket Chain Saw ",price:500}
];
cart:any[]=
[
{OrderNo:"",prodno:"", name:"", price:0 }
]
Today:Date;
M:any;
D:any;
Y:any;
H:any;
MI:any;
S:any;
MS:any;
txtOrderNo:any;
constructor() {}
Additem(p)
{
this.Today=new Date();
NEUSTCICT 2020
Page 105 of 152
this.M=String(this.Today.getMonth() );
this.D=String(this.Today.getDay() );
this.Y=String(this.Today.getFullYear() );
this.H=String(this.Today.getHours() );
this.MI=String(this.Today.getMinutes() );
this.S=String(this.Today.getSeconds() );
this.MS=String(this.Today.getUTCMilliseconds() );
Now go to Ionic Lab and then Click the “Add to Cart” buttons, you will notice
that a OrderNo(see top of your App) is generated using a combination of Months,
day, Year, Hours, Minutes, Seconds and Milliseconds, however we cannot see our
added products in the cart(by the way we don’t have a cart yet):
This is our next objective to show our added products in our cart which will be
located in the bottom, we have the program already that add products in the cart, this
is shown in the previous pages of this module, this is the .push() method (please visit
the Additem(p) function to see this ). Also the moment our product is shown in the
cart it should have a remove to cart button that when clicked the selected item in the
cart will be removed.
NEUSTCICT 2020
Page 106 of 152
Open the home.page.html and type the HTML code which is enclosed by dotted
lines. NOTES: the (click)="Removeitem(B,i)" this is the event that when clicked the
selected item (represented by index variable “i”) will be removed in the list (that is our
cart array) that variable “B” is the variable that represents our Cart items.
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>
NEUST Online Market
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true">
<ion-
input type="text" Name="txtOrderNo" [(ngModel)]="txtOrderNo" placeholder="Order
No"></ion-input>
PRODUCTS
<ion-list >
<ion-item *ngFor="let p of prods; let y = index">
<p> {{p.name}} {{p.price}}
="Additem(p)" >Add to cart </ion-button></p>
</ion-item>
</ion-list>
NEUSTCICT 2020
Page 107 of 152
</ion-item>
</ion-list>
Now let use put the instructions of removing items to cart in our function
“Removeitem(B,i)" to do these goto home.page.ts and type the code which is shown
in the dotted boxes located in the next page:
Today:Date;
M:any;
D:any;
Y:any;
H:any;
MI:any;
S:any;
MS:any;
NEUSTCICT 2020
Page 108 of 152
txtOrderNo:any;
constructor() {}
Additem(p)
{
this.Today=new Date();
this.M=String(this.Today.getMonth() );
this.D=String(this.Today.getDay() );
this.Y=String(this.Today.getFullYear() );
this.H=String(this.Today.getHours() );
this.MI=String(this.Today.getMinutes() );
this.S=String(this.Today.getSeconds() );
this.MS=String(this.Today.getUTCMilliseconds() );
Removeitem(B,i)
{
this.txtOrderNo=i ;
this.cart.splice(i,1);
}
}
Now Open the ionic lab and click tha add to cart buttons, you will notice that
your selected product will be added in the cart shown in the bottom of your app, now
try clicking the remove to cart buttons and you will notice that your selected cart item
is removed.
NEUSTCICT 2020
Page 109 of 152
EXERCISE
Design an App that will achieve Online Ramen noodle shop, like the figure
below:
Use <ion-select> to execute the ngfor to show the vaLues of each item, the
following is the clue / syntax of <ion-select> for your reference:
<IonItem>
<IonLabel>YEAR</IonLabel>
<ion-select >
NEUSTCICT 2020
Page 110 of 152
The following are the items you will display in your app and the bulleted list
below them are their Array values that will display if you click the drop arrow of the
item you choose
Dashi
● Light
● Medium
● Strong
Richness
● None
● Light
● Medium
● Rich
● Extra rich
Garlic
● None
● Drop
● Medium
● ½ Clove
● 1 clove
Chashu Sliced Pork
● No Pork
● With Pork
Spices
● None
● Mild
● Medium
● Spicy
● Very spicy
Noodle Texture
● Extra Firm
● Firm
● Medium
● Soft
NEUSTCICT 2020
Page 111 of 153
This Part of module is all about the fundamentals on how to make an app with
Tabbed pages, these tabbing is used to organize pages into one window saving space
and time of reloading. This module introduces you on how to navigate on the tabs
programmatically, we will put the instructions on the ion-buttons (actually to the
typescript file) and these instructions makes the app to jump from one tab to another
plus it will collect data and pass it to another tab, these passing of data behaves like
global variables in your previous programming subjects. Part of this module is the
“Toast” which is a messagebox that appears in the App, you will see this near the last
part of this module.
For demo purposes we will make a Registration Form that can collect data from
tabbed pages and then send them from other tabbed pages
Open your Command prompt and navigate into your folder (NOTES: Make sure
you already created the IONIC Folder inside your Documents folder)
● C:\Windows\System> cd\Users\YourUserName\Documents\IONIC\
● C:\Users\YourUserName\Documents\IONIC>cd TABSP
Open the Visual Studio Code IDE and execute the command shown below:
Open our App simulator Ionic Lab . NOTES: if this instruction below does not
work install it using this command 🡪 npm i @ionic/lab --save-dev
Here is our objective we are going to working on, create 3 pages and then we will
put them inside the tabs:
NEUSTCICT 2020
Page 112 of 153
<ion-tabs>
<ion-tab-bar slot="bottom">
<ion-tab-button tab="tab1">
<ion-icon name="triangle"></ion-icon>
<ion-label>Tab 1</ion-label>
</ion-tab-button>
<ion-tab-button tab="tab2">
<ion-icon name="ellipse"></ion-icon>
NEUSTCICT 2020
Page 113 of 153
<ion-label>Tab 2</ion-label>
</ion-tab-button>
<ion-tab-button tab="tab3">
<ion-icon name="square"></ion-icon>
<ion-label>Tab 3</ion-label>
</ion-tab-button>
</ion-tab-bar>
</ion-tabs>
Now let’s add the Webpages the Forms of Tab1, Tab2, Tab3 and the Submit
Page. Open a New Terminal and type the following commands:
ionic g page tab1
ionic g page tab2
ionic g page tab3
ionic g page tabs
ionic g page Submit
Delete All codes in app-routing.module.ts and replace it with the code below:
NEUSTCICT 2020
Page 114 of 153
The Code above gives directional navigation to the app telling the addresses
of tab1, tab2 and tab3 is under the control of “tabs page”, it also gives instruction
to the home page tabs the webpage that they will load on each tab, these codes are
globalized and can be seen by most pages, however there where times that when you
click the tab the other tabs will disappear
We said the control belongs to “tabs” well lets do it and lets put instruction to its file
tabs-routing.module.ts , go to this file and delete all the codes and replace
it with the codes as shown below
NEUSTCICT 2020
Page 115 of 153
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
NEUSTCICT 2020
Page 116 of 153
})
export class TabsPageRoutingModule {}
Our next objective is to modify our Tab pages we will put textboxes, labels and
buttons that pass Data from one Tabbed Page to another tab page (like Global
Variables):
<ion-tab-button tab="tab1">
<ion-icon name="person"></ion-icon>
<ion-label>Tab1 Form</ion-label>
</ion-tab-button>
<ion-tab-button tab="tab2">
<ion-icon name="person"></ion-icon>
<ion-label>Tab2 Form</ion-label>
</ion-tab-button>
<ion-tab-button tab="tab3">
<ion-icon name="person"></ion-icon>
<ion-label>Tab3 Form</ion-label>
</ion-tab-button>
</ion-tab-bar>
</ion-tabs>
NEUSTCICT 2020
Page 117 of 153
<ion-label>Shipping Address:</ion-label>
<ion-input type="text" placeholder="Type your Shipping Address here"[(ngModel)]="txtAddress">
</ion-input>
<ion-label>Business Name:</ion-label>
<ion-input type="text" placeholder="Type your Business name here" [(ngModel)]="txtBuss">
</ion-input>
</ion-content>
@Component({
selector: 'app-tab1',
templateUrl: './tab1.page.html',
styleUrls: ['./tab1.page.scss'],
})
NEUSTCICT 2020
Page 118 of 153
ngOnInit()
{
}
gotoTab2()
{
let NAVI:NavigationExtras={
state:{
NameNgPerson: this.txtName,
Tirahan: this.txtAddress,
Negosyo: this. txtAddress
}
}
this.router.navigate(['tabs/tab2'],NAVI);
}
The code above collects the infos of txtName, txtAddress and txtAddress which
are input textboxes of our Tab1.Page.HTML
These infos are then passed to the variables NameNgPerson, Tirahan and
Negosyo. And these variables are contained to a Navigation variable “NAVI” which
acts as a transportation to the next tabbed pages
<ion-label>Email:</ion-label>
<ion-input type="text" placeholder="Type your Email here"[(ngModel)]="txtEmail">
</ion-input>
NEUSTCICT 2020
Page 119 of 153
@Component({
selector: 'app-tab2',
templateUrl: './tab2.page.html',
styleUrls: ['./tab2.page.scss'],
})
export class Tab2Page implements OnInit {
txtTelno:any;
txtEmail:any;
fromTab1txtName:any;
fromTab1txtShipping:any;
fromTab1txtBusiness:any;
{
this.fromTab1txtName=this.router.getCurrentNavigation().extras.state.NameNgPerson
this.fromTab1txtShipping=this.router.getCurrentNavigation().extras.state.Tirahan
this.fromTab1txtBusiness=this.router.getCurrentNavigation().extras.state.Negosyo
}
});
}
ngOnInit() {
NEUSTCICT 2020
Page 120 of 153
gotoTab3(){
let NAVI:NavigationExtras={
state:{
NameNgPerson: this.fromTab1txtName,
Tirahan:this.fromTab1txtShipping,
Negosyo:this.fromTab1txtBusiness,
Tawagan: this.txtTelno,
Sulatan: this.txtEmail,
}
}
this.router.navigate(['tabs/tab3'],NAVI);
}
}
The code above collects the infos of txtTelno and txtEmail which are input
textboxes of our Tab2.Page.HTML.
Meanwhile in the constructor the variables
fromTab1txtName,fromTab1txtShipping and fromTab1txtBusiness collects data
passed by our “Tab1” page.
These infos are then passed to the variables Tawagan and Sulatan. We have
variables NameNgPerson, Tirahan and Negosyo which we recycle and reused, we
commission these variables to store our infos in “Tab1” and we will use these
variables(together with Tawagan and Sulatan) to pass it in “Tab3”.
All these variables are contained to a Navigation variable “NAVI” which acts as
a transportation to the next tabbed pages.
this.router.navigate(['tabs/tab3'],NAVI); instructs the App to got to “Tab3”
tabbed page and pass the passengers of NAVI variable also to “Tab3”.
Go to Tab3.Page.HTML and type the code as displayed below:
<ion-label>Shipping Address:</ion-label>
<ion-input type="text" [(ngModel)]="txtAddress"></ion-input>
<ion-label>Business Name:</ion-label>
<ion-input type="text" [(ngModel)]="txtBuss"></ion-input>
<ion-label>Telephone Number:</ion-label>
NEUSTCICT 2020
Page 121 of 153
In this page the user of the app must have all the
inputs filled up and must click the Submit
If the Submit is clicked the program instruction
(click)=" Submit()” will be called and executed this
program instruction is in the Tab3.Page.TS file
(see in the next instruction)
@Component({
selector: 'app-tab3',
templateUrl: './tab3.page.html',
styleUrls: ['./tab3.page.scss'],
})
this.route.queryParams.subscribe(params =>{
if(this.router.getCurrentNavigation().extras.state)
NEUSTCICT 2020
Page 122 of 153
{
this.txtName=this.router.getCurrentNavigation().extras.state.NameNgPerson
this.txtAddress=this.router.getCurrentNavigation().extras.state.Tirahan
this.txtBuss=this.router.getCurrentNavigation().extras.state.Negosyo
this.txtTelno=this.router.getCurrentNavigation().extras.state.Tawagan
this.txtEmail=this.router.getCurrentNavigation().extras.state.Sulatan
}
});
ngOnInit()
{
sabmit(){
if ( (this.txtName==null)||(this. txtAddress ==null)
|| (this.txtEmail==null) || (this.txtBuss==null)|| (this.txtTelno==null))
{
this.txtMessage="Please Fill in the Blank inputs";
}
else
{
this.txtMessage=" ";
this.ShowToast(‘Your Data is now saved in our servers’)
this.router.navigate(['/submit']);
}
message: mensahe,
duration: 5000
});
toast.present();
}
}
The code above which is the submit() procedure (executed by the click from
our button in Tab3) instructs the app to go in “Submit” page ONLY when if satisfies
the condition if the inputboxes from our tab3.page.html : txtName, txtAddress,
txtAddress, txtAddress and txtAddress ARE NOT null (which means blank)
Meanwhile our constructor displays all collected data from our “Tab2”
thanks to the NAVI Variable
The Toast Message for the App users executes in submit() procedure, this
Toast is programmed in async ShowToast(mensahe) procedure which is supported
NEUSTCICT 2020
Page 123 of 153
<ion-header>
<ion-toolbar>
<ion-title>submit</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<h1>
CONGRATULATIONS!
</ion-content>
Whenever the App user clicks the button in Tab3 and satisfy all the conditions
these Submit page will appear
NOTES: There is no database involved in this Submit page
EXERCISE
Create an App that will implement the University Enrollment form, each tab
must have buttons that pass data similar to our examples in our lesson.
In Tab1 page which is the STUDENT INFO your App must collect the following:
Birth Certificate No
NEUSTCICT 2020
Page 124 of 153
Last Name
FirstName
Middle Name
Birthday
Gender
In Tab2 which is the STUDENT ADDRESS your App must collect the following:
House Street Number
Barangay
Municipality
Province
Country
In Tab3 which is the STUDENT PARENTS your App must collect the following:
Father Name
Mother Name
Guardian
Telephone number
Email
Cellphone Number
In Tab 4 all the collected info must be displayed on each input textboxes
Do not put buttons in Tab4 and do not create a submit page.
This part of module introduces you to the basics on how to create an app with
Sidemenus, these SideMenus are used to store links that contains commands that
executes programs or to open webpages
For demonstration purposes we will create a simple “Restaurant App”, this app
will contain Sidemenus that will store links allowing the user of the App to navigate in
the different pages.
Open your Command prompt and navigate into your folder (NOTES: Make sure
you already created the IONIC Folder inside your Documents folder)
● C:\Windows\System> cd\Users\admin\Documents\IONIC\
NEUSTCICT 2020
Page 125 of 153
● C:\Users\admin\Documents\IONIC>cd menu07012021
Open the Visual Studio Code IDE by typing the command below:
Execute our App simulator Ionic SERVE or if you like IONIC LAB.
Here is our target in this module we will make side menu for Jabi Restaurant
(a fictional restaurant, that gave us a contract to do their app)
We are about to create 5 Webpages that this our example will demonstrate.
Open the Terminal prompt of your Visual Studio then on this Terminal type the
following commands:
Ionic g page Pages/meal1
Ionic g page Pages/meal2
Ionic g page Pages/meal3
Ionic g page Pages/meal4
Ionic g page Pages/meal5
NEUSTCICT 2020
Page 126 of 153
<ion-header>
<ion-toolbar>
<ion-title>
Menu Menu
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-list>
<ion-menu-toggle>
<ion-item routerLink="">
<ion-label>HOME </ion-label>
</ion-item>
</ion-menu-toggle>
<ion-menu-toggle>
<ion-item routerLink="/meal1">
<ion-label>PASTAs </ion-label>
</ion-item>
</ion-menu-toggle>
<ion-menu-toggle>
NEUSTCICT 2020
Page 127 of 153
<ion-item routerLink="/meal2">
<ion-label>BREADS</ion-label>
</ion-item>
</ion-menu-toggle>
<ion-menu-toggle>
<ion-item routerLink="/meal3">
<ion-label>DRINKS</ion-label>
</ion-item>
</ion-menu-toggle>
<ion-menu-toggle>
<ion-item routerLink="/meal4">
<ion-label>BURGERS</ion-label>
</ion-item>
</ion-menu-toggle>
<ion-menu-toggle>
<ion-item routerLink="/meal5">
<ion-label>ICE CREAMS</ion-label>
</ion-item>
</ion-menu-toggle>
</ion-list>
</ion-content>
</ion-menu>
<ion-router-outlet id="main"></ion-router-outlet>
</ion-app>
NEUSTCICT 2020
Page 128 of 153
Go to home.page.html and let’s include the menus every time our home page
appears and do the modifications as shown below:
<ion-header [translucent]="true">
<ion-toolbar>
<ion-buttons slot="start">
<ion-menu-button menu="main-menu">
</ion-menu-button>
</ion-buttons>
</ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true">
</ion-content>
Go to your Ionic Lab and Drag the Top Right Side of the Phone to show the menus
or you Can click the 3 Lined Button in the top right of the phone
Lets edit one of the pages Lets put objects, texts, pictures, angular programs in it Lets
try that in meal4 page which is the hamburgers page.
NEUSTCICT 2020
Page 129 of 153
Delete or Modify the code of meal4.page.html type the code as shown below:
<ion-header>
<ion-toolbar>
<ion-title>meal4</ion-title>
<ion-buttons slot="start">
<ion-menu-button menu="main-menu"></ion-menu-button>
</ion-buttons>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-item>
<ion-label>product</ion-label>
<ion-label></ion-label>
<ion-label> price</ion-label>
<ion-label>qty</ion-label>
<ion-label>amount</ion-label>
</ion-item>
<ion-item>
<img src="../../assets/Hamburger.jpg" height=150 width=150>
</ion-item>
<ion-item>
<ion-checkbox [(ngModel)]="checkbox1" (ionChange)="verifyEvent()"></ion-checkbox>
<ion-label>Regular Yum</ion-label>
<ion-input type="text" value=65.32 [(ngModel)]="txtPriceregularYum"> </ion-input>
NEUSTCICT 2020
Page 130 of 153
WARNING: for some reasons ionic is case sensitive in respect of filenames, so name the pictures in a
right name
Goto the location where your downloaded images are saved, Drag your downloaded images into the
Assets folder into your Visual Studio
Lets put functionality lets make the Checkboxes and Inputboxes alive and
Computing, Go to meal4.page.ts delete or modify the codes and use the code
that will appear below
NEUSTCICT 2020
Page 131 of 153
@Component({
selector: 'app-meal4',
templateUrl: './meal4.page.html',
styleUrls: ['./meal4.page.scss'],
})
constructor() { }
txtAmountregularYum:Number;
checkbox1: any;
checkbox2: any;
checkbox3: any;
txt1: any;
txtQtyregularYum:any;
txtPriceregularYum:any;
txtPriceCheeseBurger:any;
txtQtyCheeseBurger:any;
txtAmountCheeseBurger:any;
txtPriceDoublePatty:any;
txtQtyDoublePatty:any;
txtAmountDoublePatty:any;
txtTotalBurger:any;
ngOnInit() {
this.txtQtyregularYum=0;
this.txtPriceregularYum=0;
this.txtPriceCheeseBurger=0;
this.txtQtyCheeseBurger=0;
this.txtAmountCheeseBurger=0;
this.txtPriceDoublePatty=0;
this.txtQtyDoublePatty=0;
this.txtAmountDoublePatty=0;
this.txtTotalBurger=0;
verifyEvent()
NEUSTCICT 2020
Page 132 of 153
if(this.checkbox1==true){
this.txtPriceregularYum=65.32;
if(this.checkbox1==false)
this.txtPriceregularYum=0;
this.txtQtyregularYum=0;
if(this.checkbox2==true){
this.txtPriceCheeseBurger=160.43;
if(this.checkbox2==false)
this.txtPriceCheeseBurger=0;
this.txtQtyCheeseBurger=0;
if(this.checkbox3==true){
this.txtPriceDoublePatty=234.43;
if(this.checkbox3==false)
this.txtQtyDoublePatty=0;
this.txtPriceDoublePatty=0;
this.txtAmountregularYum=Number(this.txtQtyregularYum) * Number(this.txtPriceregularYum);
this.txtAmountCheeseBurger=Number(this.txtQtyCheeseBurger) * Number(this.txtPriceCheeseBurger);
this.txtAmountDoublePatty=Number(this.txtQtyDoublePatty) * Number(this.txtPriceDoublePatty);
this.txtTotalBurger=Number(this.txtAmountDoublePatty)+Number(this.txtAmountCheeseBurger)+Number(this.txtAmountregularYum);
Go to Ionic lab and check if the objects such as checkbox when checked the price of
the specific burger will appear, and also type any number in the quantity inputbox and
see if the calculations will display
NEUSTCICT 2020
Page 133 of 153
EXERCISE
Create a simple App about the Constitution of Republic of the Philippines
that will display the Preamble and at least the first 7 Articles, here is what you are
going to do:
In Menu 1 the task will be to display the Preamble
In Menu 2 display the Article 1
In Menu 2 display the Article 2
In Menu 2 display the Article 3
In Menu 2 display the Article 4
In Menu 2 display the Article 5
In Menu 2 display the Article 6
In Menu 2 display the Article 7
All contents of the Philippine constitution can be found in the Official Gazette
website https://www.officialgazette.gov.ph/constitutions/1987-constitution/
To Publish your App means to run it in your Mobile Phone (using the generated
APK file) or to sell it using your Google Account in Google Play Store. This Module
will show you how to accomplish these task step by step.
In the App you are working on Open the Terminal in your Visual Studio
Click View>Terminal
Or click Terminal>New Terminal
In this terminal type the command Ionic build –prod
NEUSTCICT 2020
Page 134 of 153
Wait…until the
process is finished
NEUSTCICT 2020
Page 135 of 153
2.) Lets make our program an Android App, type the command below to generate support files and
scripts for your program to become Android
3.) Now that your program has now Android files and scripts its time for us to open our newly
converted App into Android Studio, type the command ionic capacitor open android
NEUSTCICT 2020
Page 136 of 153
Just for your Info, only if you want to test your app in android studio (Which I do not recommend)
try to check and install the SDKs
Build APK
5.) Monitor the Event Log if the BUILD is successful, if it is click the Locate Link
NEUSTCICT 2020
Page 137 of 153
Event Log
6.) Test your APK into your smartphone (you can transfer this APK thru your USB Cable) or test your
App with the use of Emulator (BlueStacks) which you can freely download and install
The file app-debug is your APK File In your Desktop, Open the Blue
Stacks Emulator for Testing, The
Blue Stacks will act and behave as
a tablet or Smartphone
Drag your APK file into Blue Stacks wait for it to be installed once installed, double click its icon and
it will run and behave just like in the real smartphone or tablet
7.) Follow the steps to make a Final APK file which you will transfer to Google PlayStore
NEUSTCICT 2020
Page 138 of 153
Anyhow go to Google play console search it in Google and then Register, fill up necessary info and
pay the one time $ 25 payment using credit or debit card
NEUSTCICT 2020
Page 139 of 153
NEUSTCICT 2020
Page 140 of 153
NEUSTCICT 2020
Page 141 of 153
NEUSTCICT 2020
Page 142 of 153
Go back again to dashboard and fill up the store listings, make sure you have already App logos and
screen shots of what your app look like
NEUSTCICT 2020
Page 143 of 153
NEUSTCICT 2020
Page 144 of 153
12. Click Production and click Create new Release and upload your APK
13. Make sure you put all the countries you needed
NEUSTCICT 2020
Page 145 of 153
REVIEW
RELEASE
NEUSTCICT 2020
Page 146 of 153
NEUSTCICT 2020
Page 147 of 153
CASE STUDY
Your instructor will select a case study problem for your group. The group Leader
and the members must finish the case study in the given deadline of your instructor.
CASE STUDY 1: Create a Botany information system for the College of Biology.
This app is divided into 5 categories: Trees, Shrubs, Herbs, Cactuses, Grasses on
each category there should be 5 species with information and pictures
CASE STUDY 2: Create a simple multiple-choice reviewer for the Civil Service
exam it must have 5 Categories Vocabulary Questions, Idiomatic Expressions,
Reading comprehension test, Numerical Reasoning and Word analogy logic test.
Each category must have 10 questions each and it must show the score to the user
after each of the category is finished.
CASE STUDY 3: The College of Electrical Engineering is asking for an App to have
electrical equations calculator these are Voltage, Current, Resistance, Conductance,
Power, Capacitance, Inductance, Impedance, Charge, Frequency and Time Period
CASE STUDY 4: The Education Department is asking for a Noli me Tangere App for
the students of the remote province of Ifugao, Abra and Guimaras it must have 15
chapters with pictures and the whole content of the book.
CASE STUDY 5: Because of lack of funds in printing the Local Government of the
Province of Siquijor is asking a El Filibusterismo App to be used by the students of
the provincial high school.
CASE STUDY 6: The National Research of Chemistry is asking you the Mobile App
developers to create an App that list all the periodic table of elements(in a side
menu), they require that when they tap an element the related info will be shown
together with the picture (periodic elements contain 118 items but you will only
choose 50 items to be shown in the App)
CASE STUDY 7: Create the multiple-choice practice exam reviewer for College of
Law, it must have 5 categories: Remedial law, Civil Law, Mercantile Law, Taxation
and Criminal law. Each category must have 10 questions and must display the score
after the practice.
CASE STUDY 8: The Japanese Multinational company the MechWarrior’s Car
Company is asking for an app for their employees to perform Newtonian mechanics
calculations these are : Kinematics, Net Force, Friction force, Centripetal
acceleration, torque, momentum, impulse, power, velocity power, spring force,
NEUSTCICT 2020
Page 148 of 153
NEUSTCICT 2020