
Domains
Agile Management
Master Agile methodologies for efficient and timely project delivery.
View All Agile Management Coursesicon-refresh-cwCertifications
Scrum Alliance
16 Hours
Best Seller
Certified ScrumMaster (CSM) CertificationScrum Alliance
16 Hours
Best Seller
Certified Scrum Product Owner (CSPO) CertificationScaled Agile
16 Hours
Trending
Leading SAFe 6.0 CertificationScrum.org
16 Hours
Professional Scrum Master (PSM) CertificationScaled Agile
16 Hours
SAFe 6.0 Scrum Master (SSM) CertificationAdvanced Certifications
Scaled Agile, Inc.
32 Hours
Recommended
Implementing SAFe 6.0 (SPC) CertificationScaled Agile, Inc.
24 Hours
SAFe 6.0 Release Train Engineer (RTE) CertificationScaled Agile, Inc.
16 Hours
Trending
SAFe® 6.0 Product Owner/Product Manager (POPM)IC Agile
24 Hours
ICP Agile Certified Coaching (ICP-ACC)Scrum.org
16 Hours
Professional Scrum Product Owner I (PSPO I) TrainingMasters
32 Hours
Trending
Agile Management Master's Program32 Hours
Agile Excellence Master's ProgramOn-Demand Courses
Agile and ScrumRoles
Scrum MasterTech Courses and Bootcamps
Full Stack Developer BootcampAccreditation Bodies
Scrum AllianceTop Resources
Scrum TutorialProject Management
Gain expert skills to lead projects to success and timely completion.
View All Project Management Coursesicon-standCertifications
PMI
36 Hours
Best Seller
Project Management Professional (PMP) CertificationAxelos
32 Hours
PRINCE2 Foundation & Practitioner CertificationAxelos
16 Hours
PRINCE2 Foundation CertificationAxelos
16 Hours
PRINCE2 Practitioner CertificationSkills
Change ManagementMasters
Job Oriented
45 Hours
Trending
Project Management Master's ProgramUniversity Programs
45 Hours
Trending
Project Management Master's ProgramOn-Demand Courses
PRINCE2 Practitioner CourseRoles
Project ManagerAccreditation Bodies
PMITop Resources
Theories of MotivationCloud Computing
Learn to harness the cloud to deliver computing resources efficiently.
View All Cloud Computing Coursesicon-cloud-snowingCertifications
AWS
32 Hours
Best Seller
AWS Certified Solutions Architect - AssociateAWS
32 Hours
AWS Cloud Practitioner CertificationAWS
24 Hours
AWS DevOps CertificationMicrosoft
16 Hours
Azure Fundamentals CertificationMicrosoft
24 Hours
Best Seller
Azure Administrator CertificationMicrosoft
45 Hours
Recommended
Azure Data Engineer CertificationMicrosoft
32 Hours
Azure Solution Architect CertificationMicrosoft
40 Hours
Azure DevOps CertificationAWS
24 Hours
Systems Operations on AWS Certification TrainingAWS
24 Hours
Developing on AWSMasters
Job Oriented
48 Hours
New
AWS Cloud Architect Masters ProgramBootcamps
Career Kickstarter
100 Hours
Trending
Cloud Engineer BootcampRoles
Cloud EngineerOn-Demand Courses
AWS Certified Developer Associate - Complete GuideAuthorized Partners of
AWSTop Resources
Scrum TutorialIT Service Management
Understand how to plan, design, and optimize IT services efficiently.
View All DevOps Coursesicon-git-commitCertifications
Axelos
16 Hours
Best Seller
ITIL 4 Foundation CertificationAxelos
16 Hours
ITIL Practitioner CertificationPeopleCert
16 Hours
ISO 14001 Foundation CertificationPeopleCert
16 Hours
ISO 20000 CertificationPeopleCert
24 Hours
ISO 27000 Foundation CertificationAxelos
24 Hours
ITIL 4 Specialist: Create, Deliver and Support TrainingAxelos
24 Hours
ITIL 4 Specialist: Drive Stakeholder Value TrainingAxelos
16 Hours
ITIL 4 Strategist Direct, Plan and Improve TrainingOn-Demand Courses
ITIL 4 Specialist: Create, Deliver and Support ExamTop Resources
ITIL Practice TestData Science
Unlock valuable insights from data with advanced analytics.
View All Data Science Coursesicon-dataBootcamps
Job Oriented
6 Months
Trending
Data Science BootcampJob Oriented
289 Hours
Data Engineer BootcampJob Oriented
6 Months
Data Analyst BootcampJob Oriented
288 Hours
New
AI Engineer BootcampSkills
Data Science with PythonRoles
Data ScientistOn-Demand Courses
Data Analysis Using ExcelTop Resources
Machine Learning TutorialDevOps
Automate and streamline the delivery of products and services.
View All DevOps Coursesicon-terminal-squareCertifications
DevOps Institute
16 Hours
Best Seller
DevOps Foundation CertificationCNCF
32 Hours
New
Certified Kubernetes AdministratorDevops Institute
16 Hours
Devops LeaderSkills
KubernetesRoles
DevOps EngineerOn-Demand Courses
CI/CD with Jenkins XGlobal Accreditations
DevOps InstituteTop Resources
Top DevOps ProjectsBI And Visualization
Understand how to transform data into actionable, measurable insights.
View All BI And Visualization Coursesicon-microscopeBI and Visualization Tools
Certification
24 Hours
Recommended
Tableau CertificationCertification
24 Hours
Data Visualization with Tableau CertificationMicrosoft
24 Hours
Best Seller
Microsoft Power BI CertificationTIBCO
36 Hours
TIBCO Spotfire TrainingCertification
30 Hours
Data Visualization with QlikView CertificationCertification
16 Hours
Sisense BI CertificationOn-Demand Courses
Data Visualization Using Tableau TrainingTop Resources
Python Data Viz LibsCyber Security
Understand how to protect data and systems from threats or disasters.
View All Cyber Security Coursesicon-refresh-cwCertifications
CompTIA
40 Hours
Best Seller
CompTIA Security+EC-Council
40 Hours
Certified Ethical Hacker (CEH v12) CertificationISACA
22 Hours
Certified Information Systems Auditor (CISA) CertificationISACA
40 Hours
Certified Information Security Manager (CISM) Certification(ISC)²
40 Hours
Certified Information Systems Security Professional (CISSP)(ISC)²
40 Hours
Certified Cloud Security Professional (CCSP) Certification16 Hours
Certified Information Privacy Professional - Europe (CIPP-E) CertificationISACA
16 Hours
COBIT5 Foundation16 Hours
Payment Card Industry Security Standards (PCI-DSS) CertificationOn-Demand Courses
CISSPTop Resources
Laptops for IT SecurityWeb Development
Learn to create user-friendly, fast, and dynamic web applications.
View All Web Development Coursesicon-codeBootcamps
Career Kickstarter
6 Months
Best Seller
Full-Stack Developer BootcampJob Oriented
3 Months
Best Seller
UI/UX Design BootcampEnterprise Recommended
6 Months
Java Full Stack Developer BootcampCareer Kickstarter
490+ Hours
Front-End Development BootcampCareer Accelerator
4 Months
Backend Development Bootcamp (Node JS)Skills
ReactOn-Demand Courses
Angular TrainingTop Resources
Top HTML ProjectsBlockchain
Understand how transactions and databases work in blockchain technology.
View All Blockchain Coursesicon-stop-squareBlockchain Certifications
40 Hours
Blockchain Professional Certification32 Hours
Blockchain Solutions Architect Certification32 Hours
Blockchain Security Engineer Certification24 Hours
Blockchain Quality Engineer Certification5+ Hours
Blockchain 101 CertificationOn-Demand Courses
NFT Essentials 101: A Beginner's GuideTop Resources
Blockchain Interview QsProgramming
Learn to code efficiently and design software that solves problems.
View All Programming Coursesicon-codeSkills
Python CertificationInterview Prep
Career Accelerator
3 Months
Software Engineer Interview PrepOn-Demand Courses
Data Structures and Algorithms with JavaScriptTop Resources
Python TutorialBefore beginning with Ionic, it is essential to have good knowledge of Angular. Angular programs are written in TypeScript.
But before looking at TypeScript we will also take a brief look at Node JS. Node JS is a server environment that runs JavaScript. The easiest way to run TypeScript is within Node.
Node comes with its package manager - NPM - Node Package Manager. NPM is the world’s largest package repository. It is the most common mechanism to distribute open source software. TypeScript, Angular and Node are made available via node.
At the most fundamental level it is important to get a sense of what TypeScript is and what the programming language looks like. This is done best by means of practical examples. It is recommended that you try the examples in this tutorial before proceeding to Ionic.
From the TypeScript website...

As mentioned above, TypeScript is made available through Node JS. If you do not have Node already installed, you can install it from:
https://nodejs.org/en/download/
Once you have node installed, you have Node’s package manager available. TypeScript can be installed using:
TypeScript compiles to JavaScript and Node executes the JavaScript files. To be precise, Node is a JavaScript runtime environment, much like JRE for Java. It contains everything that JavaScript needs to run.
It is built on Chrome’s JavaScript V8 Engine. It converts JavaScript to Machine Code
What does the JavaScript V8 Engine do in Chrome/ Node
Each browser has its own JavaScript Engine. Chrome runs V8, Firefox runs SpiderMonkey, and Internet Explorer, Chakra. Each has its own compatibility issues.
https://kangax.github.io/compat-table/es6/
Angular 2 is a complete rewrite of AngularJS, which was written in JavaScript. Microsoft added annotations to TypeScript language, and made it the language for the development of the Angular 2 framework itself.
Download and install Visual Studio Code from https://code.visualstudio.com/
With this background, we are good to get started with TypeScript. This will be a brief introduction so that we know enough to get introduced to Angular/ Ionic.
Hello World
1. Create a new folder TypeScript Tutorial
2. Open Visual Studio Code and import the folder

3. And create a new file (Hello.ts) by right clicking on the folder in the folder and type
console.log(“Hello World”)

4. Save the file
5. Open the integrated terminal


6. type tsc hello.ts
7. You will notice that TypeScript has been compiled into a JavaScript file hello.js
8. On the command prompt run node hello. The JavaScript engine within node will run the JavaScript file and print “Hello World” on the console

In addition to doing a “hello world” in TypeScript, you now know how to import a folder and create files in TypeScript. You also now know how to run commands within the editor.
A variable is used to store, retrieve and manipulate information in a programming language. TypeScript uses the key words let and const to declare variables.
let greeting = “hello world”
console.log(greeting)
const greeting2 = “hello world”
console.log(greeting2)
A variable declared using Const needs to be initialized and it cannot be reassigned.


In the images above, it is seen that Visual Studio Code flags the variable “a” with an error when it is not initialized and when it is reassigned a value.
TypeScript supports 3 data types. As mentioned earlier using data types is optional.
1. Boolean
2. Number
3. String
let name : string = “Josh”
let age : number = 22
let isStudent : boolean = true
4. Variables can be assigned as null or undefined
let name : string = null
let name : string = undefined
5. Types are checked in compile time

6. Allows intellisense in the editor. Intellisense is Microsoft’s way of intelligent code completion.

An expression is a combination of operators and operands. Operands can be constants, variables or other expressions.

a= 12 * b + c;
12, b, c are operands in the expression and =,*,+ are operators.
TypeScript supports the following operators:
Arithmetic operators | +, -, *, /, %, ++, -- |
Logical operators | && (AND), || (OR), ! (NOT) |
Relational operators | >, <, >=, <=, != (not equal), == (equal) |
Assignment operators | =, +=, -=, *=, /=, %= |
Ternary/conditional operator | let t = 10>20?”smaller”:”larger”; Will store “smaller” in t |
TypeOf Operator | “ var a = 12; console.log(typeof a)” will return “number” |
Bitwise operators | & (AND). | (OR), ^ (XOR), ~ ( Not), << (Left Shift), >> (Right Shift), >>> (Right shift with Zero) |
Template Strings
A template string is a string which is enclosed within back-tick characters (`). It can include expressions within ${ }. TypeScript replaces placeholders with real values. Template strings are a better option to use when compared to string concatenation.
let name = 'Josh';
console.log('name ' + name)
let statement = `I am
${name}`
console.log(statement)
The output will be:

An array is a data structure that contains a group of elements. Typically these elements are all of the same data type, such as a number or string. Arrays are commonly used in computer programs to organize data so that a related set of values can be easily sorted or searched.
You can declare an array in 2 ways:
let list1 :number[] = [1,2,3]
let list2: Array<number> = [1,2,3]
String arrays
let list3: Array<string> = ['1','2','3']
let list4: Array<string> = [`1
${list2}`,'2','3']
console.log(list4)

'any' is used when you are not sure what the data type is. When a variable is declared as “any” it can be assigned any value
let a :any;
a = "200";
a = 200;
a = false;
console.log(a)
A tuple is an array of fixed length. It allows multiple types in a single array.
let student : [string,number] = ['josh',2]
console.log(student)

Type inference happens in TypeScript when there is no explicit data type specified and the variable is initialized.
The following will work
let a
a = true
a= 1
The following will throw an error since the type is inferred as number;
let a = 10
a = true
TypeScript allows multiple types for a single variable. You can achieve this by using the pipe symbol in the variable declaration. This is normally used when the data stored in the variable is not under your control.
In comparison to “any”, it allows a higher degree of control. It also provides intellisense support.
let a :number|string;
a=20;
a="zoom"
Below is the Intellisense for a when is a union of number and string

Below is the Intellisense when it is any

In any programming language, functions define how to do things.
1. A simplest function will look like this:
function printHello(){
console.log('Hello')
}
printHello()
2. A function can receive parameters as below
function printHello(message){
console.log(message)
}
printHello('hello')
3. Parameter is declared with a type
function printHello(message:string){
console.log(message)
}
printHello('hello')
4. Multiple Parameters
function printHello(message:string, name:string){
console.log(message + " " + name)
}
printHello('hello', 'josh')
5. Optional Parameters
Optional parameters are suffixed with a question mark
function printHello(message:string, name?:string){
if(name)
console.log(message + " " + name)
else
console.log(message )
}
printHello('hello', 'josh')
printHello('hello, how are you' )
The output will be

6. Default values for parameters
If a parameter is not passed, it can be initialized with a default value
function printHello(message:string = 'Hello', name?:string){
if(name)
console.log(message + " " + name)
else
console.log(message )
}
printHello()

7. Defining return types
A return type is defined as below
function printHello(message:string, name:string):string{
if(name)
return message + " " + name
else
return message
}
let message = printHello("Hello", "Josh");
console.log(message);
A class is a template for an object and an object is an instance of a class.
Below is an example of a TypeScript class
class Person{
firstName:string;
lastName:string;
sayHello(){
console.log("hello " + this.firstName)
}
sayGoodBye(){
console.log("bye " + this.firstName)
}
}
An instance of the class is created as follows
let max = new Person();
max.firstName = "Max";
max.lastName = "Payne";
max.sayHello();
console.log(max);

Constructors are used to initialize classes. They are automatically called when the class is created
class Person{
firstName:string;
lastName:string;
constructor(firstName:string, lastName?:string){
this.firstName = firstName;
this.lastName = lastName;
}
sayHello(){
console.log("hello " + this.firstName)
}
sayGoodBye(){
console.log("bye " + this.firstName)
}
}
let max = new Person("Max", "Payne");
max.sayHello();
console.log(max);

A class can have optional properties as follows
lastName?:string;
Objects arrays can be initialized as follows:
let persons :Person[] =
[{"firstName":"Quintin","lastName":"Tarantino"},
{"firstName":"Steven","lastName":"Spielberg"},
{"firstName":"Christopher","lastName":"Nolan"}]
They can be looped through using a for loop as follows
for(let i=0; i<persons.length; i++){
console.log(`${i} ${persons[i].firstName}
${persons[i].lastName}`)
}
Or using a while loop
let i=0;
while(i<persons.length){
console.log(`${i} ${persons[i].firstName}
${persons[i].lastName}`)
i++;
}
Interfaces specify “what” a class must do, but not “how”. They define the structure of a class.
interface Person{
firstName:string;
lastName:string;
sayHello();
sayGoodBye();
}
The implementation of sayHello and sayGoodBye is upto the classes that implement the interface to define.
Class SimplePerson implements Person{
firstName:string;
lastName:string;
sayHello(){
console.log(“Simple Hello”;
}
sayGoodBye(){
console.log(“Simple Bye”;
}
}
Class ComplexPerson implements Person{
firstName:string;
lastName:string;
sayHello(){
console.log(“Complex Hello”;
}
sayGoodBye(){
console.log(“Complex Bye”;
}
}
Modules are executed within their own scope, not in the global scope; this means that variables, functions, classes, etc. declared in a module are not visible outside the module unless they are explicitly exported from the module and imported into the program using them.
In the above example, the interface Person will not be accessible unless it is imported.
export interface Person {
firstName:string;
lastName:string;
sayHello();
sayGoodBye();
}
The class implementing the interface has to import the module
import { Person } from "./helloInterface";
class Person3 implements Person{
The key points to be noted here are the export keyword and import statement
TypeScript applies object oriented programming to JavaScript. The process of conversion of TypeScript to JavaScript is an example of transpilation.
One of the key advantages of transpilation is that it allows us to use future features of JavaScript today.