SlideShare a Scribd company logo
Getting Started with
Angular 4 and
TypeScript
INTRODUCTION BY AHMED LOTFY EL-KADY
1
What is TypeScript ?
TypeScript is a typed superset of
JavaScript that compiles to plain
JavaScript.
2
TypeScript Content
Why TypeScript ?
Interfaces
Classes
Decorators
Import and Export
3
Why TypeScript ?
•TypeScript Has Great Tools
•TypeScript is a Superset of JavaScript
•TypeScript Makes Abstractions Explicit
•TypeScript Makes Code Easier to Read and Understand
4
TypeScript Interfaces
5
TypeScript Decorators
Like attributes in C#
6
Import and Export
Like using statements in C#
import statements allow us to reference code from other TypeScript files
export simply means public
7
What is Angular JS ?
A JavaScript framework For
building client-side applications
Using HTML, CSS and JavaScript
8
Angular Architecture Overview
9
Anatomy of an Angular Application
Application Component Component Component
Services
10
Setting up an Angular Application
1. Install NodeJS And NPM
2. Create an application folder
3. Create the tsconfig.json file
4. Create the package.json file
5. Create the typings.json file
6. Install the libraries and typings
7. Create the host Web page (index.html)
8. Create the main.ts file (bootstrapper)
11
Angular CLI
1. npm install -g @angular/cli
2. ng new PROJECT_NAME
3. cd PROJECT_NAME
4. ng serve
12
Running your application
Import your root NgModule
Bootstrap it!
13
Modules
Angular apps are modular and Angular has its own modularity system called Angular modules or
NgModules.
Every Angular app has at least one Angular module class, the root module, conventionally
named AppModule
Angular ships as a collection of JavaScript modules. You can think of them as library modules.
Each Angular library name begins with the @angular prefix
You install them with the npm package manager and import parts of them with JavaScript
Import statements.
14
Components
15
Component Template
Class
Properties
Methods
Metadata
Components
16
Templates
You define a component's view with its companion template. A template is a form of HTML that
tells Angular how to render the component.
17
Metadata
Metadata tells Angular how to process a class.
In TypeScript, you attach metadata by using a decorator.
The template, metadata, and component together describe a view.
The metadata in the @Component tells Angular where to get the major building blocks you
specify for the component.
Apply other metadata decorators in a similar fashion to guide Angular behavior. @Injectable,
@Input and @Output are a few of the more popular decorators.
18
Data binding
Angular supports data binding, a mechanism
for coordinating parts of a template with parts
of a component. Add binding markup to the
template HTML to tell Angular how to connect
both sides.
There are four forms of data binding syntax.
Each form has a direction — to the DOM, from
the DOM, or in both directions.
19
Pipes
Pipes are used in the templates to improve the user experience by transforming
values for display.
Example:
{{ price | currency:'USD':true }}
It displays a price of 42.33 as $42.33
20
Services
Services are best used to create, read, update and delete data
Enforces separation of concerns
Think of it like this: you don’t want your database in your view!
21
Service Creation
Step 1 – Make class with data
22
Service Creation
Step 2 – Import @Injectable and decorate
23
Service Creation
Steps 3 and 4 – Import and register
24
Service Creation
Step 5 – Add as property and to constructor
25
Thank You!
26

More Related Content

What's hot (20)

PPTX
Angular modules in depth
Christoffer Noring
 
PPTX
Angular interview questions
Goa App
 
PPTX
What’s New in Angular 14?
Albiorix Technology
 
PPTX
Angular 5 presentation for beginners
Imran Qasim
 
PPTX
Angular
sridhiya
 
PDF
Angular
Lilia Sfaxi
 
PDF
Angular - Chapter 7 - HTTP Services
WebStackAcademy
 
DOCX
Angular Interview Questions & Answers
Ratnala Charan kumar
 
PPTX
API Docs with OpenAPI 3.0
Fabrizio Ferri-Benedetti
 
PPTX
Introduction to angular with a simple but complete project
Jadson Santos
 
PDF
Angular 4 Tutorial | What's New In Angular 4 | Angular Training | Edureka
Edureka!
 
PDF
Developing Cross platform apps in flutter (Android, iOS, Web)
Priyanka Tyagi
 
PPSX
Rest api standards and best practices
Ankita Mahajan
 
PPTX
What is Swagger?
Philip Senger
 
PDF
Angular 10 course_content
NAVEENSAGGAM1
 
PPTX
Angular
TejinderMakkar
 
PPTX
Angular vs react
Infinijith Technologies
 
ODP
Angular 6 - The Complete Guide
Sam Dias
 
PPT
Graphql presentation
Vibhor Grover
 
Angular modules in depth
Christoffer Noring
 
Angular interview questions
Goa App
 
What’s New in Angular 14?
Albiorix Technology
 
Angular 5 presentation for beginners
Imran Qasim
 
Angular
sridhiya
 
Angular
Lilia Sfaxi
 
Angular - Chapter 7 - HTTP Services
WebStackAcademy
 
Angular Interview Questions & Answers
Ratnala Charan kumar
 
API Docs with OpenAPI 3.0
Fabrizio Ferri-Benedetti
 
Introduction to angular with a simple but complete project
Jadson Santos
 
Angular 4 Tutorial | What's New In Angular 4 | Angular Training | Edureka
Edureka!
 
Developing Cross platform apps in flutter (Android, iOS, Web)
Priyanka Tyagi
 
Rest api standards and best practices
Ankita Mahajan
 
What is Swagger?
Philip Senger
 
Angular 10 course_content
NAVEENSAGGAM1
 
Angular vs react
Infinijith Technologies
 
Angular 6 - The Complete Guide
Sam Dias
 
Graphql presentation
Vibhor Grover
 

Similar to Angular 4 and TypeScript (20)

PPTX
Angularjs2 presentation
dharisk
 
PPTX
Angularj2.0
Mallikarjuna G D
 
PPTX
Dive into Angular, part 4: Angular 2.0
Oleksii Prohonnyi
 
PDF
Introduction To Angular 4 - J2I
Nader Debbabi
 
PPTX
An Overview of Angular 4
Cynoteck Technology Solutions Private Limited
 
PPTX
Introduction to Angular2
Knoldus Inc.
 
PPTX
Angular4 getting started
TejinderMakkar
 
PPTX
Angular Basics.pptx
AshokKumar616995
 
PPT
17612235.ppt
yovixi5669
 
PPTX
Angular Course.pptx
Imdad Ullah
 
PPTX
Foster - Getting started with Angular
MukundSonaiya1
 
PPTX
4 Anguadasdfasdasdfasdfsdfasdfaslar (1).pptx
tilejak773
 
PPTX
Angular Framework ppt for beginners and advanced
Preetha Ganapathi
 
PDF
Angular2
SitaPrajapati
 
PDF
Angular 2 introduction
Christoffer Noring
 
PDF
Angular2 with type script
Ravi Mone
 
PPTX
Angular kickstart slideshare
SaleemMalik52
 
PDF
better-apps-angular-2-day1.pdf and home
ChethanGowda886434
 
PDF
Angular js
Felixits
 
Angularjs2 presentation
dharisk
 
Angularj2.0
Mallikarjuna G D
 
Dive into Angular, part 4: Angular 2.0
Oleksii Prohonnyi
 
Introduction To Angular 4 - J2I
Nader Debbabi
 
Introduction to Angular2
Knoldus Inc.
 
Angular4 getting started
TejinderMakkar
 
Angular Basics.pptx
AshokKumar616995
 
17612235.ppt
yovixi5669
 
Angular Course.pptx
Imdad Ullah
 
Foster - Getting started with Angular
MukundSonaiya1
 
4 Anguadasdfasdasdfasdfsdfasdfaslar (1).pptx
tilejak773
 
Angular Framework ppt for beginners and advanced
Preetha Ganapathi
 
Angular2
SitaPrajapati
 
Angular 2 introduction
Christoffer Noring
 
Angular2 with type script
Ravi Mone
 
Angular kickstart slideshare
SaleemMalik52
 
better-apps-angular-2-day1.pdf and home
ChethanGowda886434
 
Angular js
Felixits
 
Ad

Recently uploaded (20)

PPTX
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
PDF
Powering GIS with FME and VertiGIS - Peak of Data & AI 2025
Safe Software
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PPTX
Coefficient of Variance in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Understanding the Need for Systemic Change in Open Source Through Intersectio...
Imma Valls Bernaus
 
PPTX
Fundamentals_of_Microservices_Architecture.pptx
MuhammadUzair504018
 
PDF
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Nabin Dhakal
 
PDF
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
PDF
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
PPTX
MailsDaddy Outlook OST to PST converter.pptx
abhishekdutt366
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
PPTX
Equipment Management Software BIS Safety UK.pptx
BIS Safety Software
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
PPTX
Human Resources Information System (HRIS)
Amity University, Patna
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
PDF
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
PPTX
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
PPTX
Writing Better Code - Helping Developers make Decisions.pptx
Lorraine Steyn
 
PPTX
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
Powering GIS with FME and VertiGIS - Peak of Data & AI 2025
Safe Software
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Coefficient of Variance in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Understanding the Need for Systemic Change in Open Source Through Intersectio...
Imma Valls Bernaus
 
Fundamentals_of_Microservices_Architecture.pptx
MuhammadUzair504018
 
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Nabin Dhakal
 
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
MailsDaddy Outlook OST to PST converter.pptx
abhishekdutt366
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
Equipment Management Software BIS Safety UK.pptx
BIS Safety Software
 
Tally software_Introduction_Presentation
AditiBansal54083
 
Human Resources Information System (HRIS)
Amity University, Patna
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
Writing Better Code - Helping Developers make Decisions.pptx
Lorraine Steyn
 
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
Ad

Angular 4 and TypeScript

  • 1. Getting Started with Angular 4 and TypeScript INTRODUCTION BY AHMED LOTFY EL-KADY 1
  • 2. What is TypeScript ? TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. 2
  • 3. TypeScript Content Why TypeScript ? Interfaces Classes Decorators Import and Export 3
  • 4. Why TypeScript ? •TypeScript Has Great Tools •TypeScript is a Superset of JavaScript •TypeScript Makes Abstractions Explicit •TypeScript Makes Code Easier to Read and Understand 4
  • 7. Import and Export Like using statements in C# import statements allow us to reference code from other TypeScript files export simply means public 7
  • 8. What is Angular JS ? A JavaScript framework For building client-side applications Using HTML, CSS and JavaScript 8
  • 10. Anatomy of an Angular Application Application Component Component Component Services 10
  • 11. Setting up an Angular Application 1. Install NodeJS And NPM 2. Create an application folder 3. Create the tsconfig.json file 4. Create the package.json file 5. Create the typings.json file 6. Install the libraries and typings 7. Create the host Web page (index.html) 8. Create the main.ts file (bootstrapper) 11
  • 12. Angular CLI 1. npm install -g @angular/cli 2. ng new PROJECT_NAME 3. cd PROJECT_NAME 4. ng serve 12
  • 13. Running your application Import your root NgModule Bootstrap it! 13
  • 14. Modules Angular apps are modular and Angular has its own modularity system called Angular modules or NgModules. Every Angular app has at least one Angular module class, the root module, conventionally named AppModule Angular ships as a collection of JavaScript modules. You can think of them as library modules. Each Angular library name begins with the @angular prefix You install them with the npm package manager and import parts of them with JavaScript Import statements. 14
  • 17. Templates You define a component's view with its companion template. A template is a form of HTML that tells Angular how to render the component. 17
  • 18. Metadata Metadata tells Angular how to process a class. In TypeScript, you attach metadata by using a decorator. The template, metadata, and component together describe a view. The metadata in the @Component tells Angular where to get the major building blocks you specify for the component. Apply other metadata decorators in a similar fashion to guide Angular behavior. @Injectable, @Input and @Output are a few of the more popular decorators. 18
  • 19. Data binding Angular supports data binding, a mechanism for coordinating parts of a template with parts of a component. Add binding markup to the template HTML to tell Angular how to connect both sides. There are four forms of data binding syntax. Each form has a direction — to the DOM, from the DOM, or in both directions. 19
  • 20. Pipes Pipes are used in the templates to improve the user experience by transforming values for display. Example: {{ price | currency:'USD':true }} It displays a price of 42.33 as $42.33 20
  • 21. Services Services are best used to create, read, update and delete data Enforces separation of concerns Think of it like this: you don’t want your database in your view! 21
  • 22. Service Creation Step 1 – Make class with data 22
  • 23. Service Creation Step 2 – Import @Injectable and decorate 23
  • 24. Service Creation Steps 3 and 4 – Import and register 24
  • 25. Service Creation Step 5 – Add as property and to constructor 25