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

PPTX
Unit 1 - TypeScript & Introduction to Angular CLI.pptx
PPTX
PPT
JAVA SCRIPT
PPTX
Express js
PDF
Angular Observables & RxJS Introduction
PPTX
Angular 9
PDF
TypeScript Best Practices
PPTX
Introduction to NodeJS
Unit 1 - TypeScript & Introduction to Angular CLI.pptx
JAVA SCRIPT
Express js
Angular Observables & RxJS Introduction
Angular 9
TypeScript Best Practices
Introduction to NodeJS

What's hot (20)

PDF
NodeJS for Beginner
PPTX
TypeScript VS JavaScript.pptx
PPTX
PPTX
Angular 14.pptx
PDF
TypeScript - An Introduction
PPTX
Introduction to Node.js
PPTX
TypeScript Overview
PDF
Angular Advanced Routing
PDF
TypeScript Introduction
PPTX
Angularjs PPT
PPTX
Sharing Data Between Angular Components
PPTX
Getting started with typescript
PDF
Node.js Express Tutorial | Node.js Tutorial For Beginners | Node.js + Expres...
PPTX
PPTX
Introduction to spring boot
PPTX
API Docs with OpenAPI 3.0
PDF
Angular - Chapter 1 - Introduction
PDF
TypeScript
PPTX
Meetup angular http client
PDF
gRPC - RPC rebirth?
NodeJS for Beginner
TypeScript VS JavaScript.pptx
Angular 14.pptx
TypeScript - An Introduction
Introduction to Node.js
TypeScript Overview
Angular Advanced Routing
TypeScript Introduction
Angularjs PPT
Sharing Data Between Angular Components
Getting started with typescript
Node.js Express Tutorial | Node.js Tutorial For Beginners | Node.js + Expres...
Introduction to spring boot
API Docs with OpenAPI 3.0
Angular - Chapter 1 - Introduction
TypeScript
Meetup angular http client
gRPC - RPC rebirth?
Ad

Similar to Angular 4 and TypeScript (20)

PPTX
Angular 5 presentation for beginners
PDF
Introduction To Angular 4 - J2I
PPTX
Angular Basics.pptx
PPTX
Dive into Angular, part 4: Angular 2.0
PDF
Integrating TypeScript with popular frameworks like React or Angular.pdf
PPTX
4 Anguadasdfasdasdfasdfsdfasdfaslar (1).pptx
PPTX
Angular kickstart slideshare
PPTX
Angularjs2 presentation
PDF
Angular2 with TypeScript
PPTX
Angular Framework ppt for beginners and advanced
PPTX
How Does Angular Work?
PPTX
Single Page Applications in SharePoint with Angular
PPTX
Angular interview questions
PPTX
Web Techdfasvfsvgsfgnolofgdfggy Unit I.pptx
PPTX
Angular IO
PDF
Angular
PPTX
mobile development using node js and java
PDF
Mastering angular - Dot Net Tricks
PPTX
Angularj2.0
PDF
Reasons to Use Typescript for Your Next Project Over Javascript.pdf
Angular 5 presentation for beginners
Introduction To Angular 4 - J2I
Angular Basics.pptx
Dive into Angular, part 4: Angular 2.0
Integrating TypeScript with popular frameworks like React or Angular.pdf
4 Anguadasdfasdasdfasdfsdfasdfaslar (1).pptx
Angular kickstart slideshare
Angularjs2 presentation
Angular2 with TypeScript
Angular Framework ppt for beginners and advanced
How Does Angular Work?
Single Page Applications in SharePoint with Angular
Angular interview questions
Web Techdfasvfsvgsfgnolofgdfggy Unit I.pptx
Angular IO
Angular
mobile development using node js and java
Mastering angular - Dot Net Tricks
Angularj2.0
Reasons to Use Typescript for Your Next Project Over Javascript.pdf
Ad

Recently uploaded (20)

PDF
AI Guide for Business Growth - Arna Softech
PDF
Guide to Food Delivery App Development.pdf
PDF
The Dynamic Duo Transforming Financial Accounting Systems Through Modern Expe...
PPTX
4Seller: The All-in-One Multi-Channel E-Commerce Management Platform for Glob...
PPTX
How to Odoo 19 Installation on Ubuntu - CandidRoot
PDF
iTop VPN Crack Latest Version Full Key 2025
PPTX
Lecture 5 Software Requirement Engineering
PDF
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
PDF
Practical Indispensable Project Management Tips for Delivering Successful Exp...
PPTX
Full-Stack Developer Courses That Actually Land You Jobs
PPTX
Cybersecurity-and-Fraud-Protecting-Your-Digital-Life.pptx
PPTX
Download Adobe Photoshop Crack 2025 Free
PPTX
Introduction to Windows Operating System
DOC
UTEP毕业证学历认证,宾夕法尼亚克拉里恩大学毕业证未毕业
DOCX
Modern SharePoint Intranet Templates That Boost Employee Engagement in 2025.docx
PDF
Workplace Software and Skills - OpenStax
PDF
DuckDuckGo Private Browser Premium APK for Android Crack Latest 2025
PDF
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
PPTX
Airline CRS | Airline CRS Systems | CRS System
PDF
Microsoft Office 365 Crack Download Free
AI Guide for Business Growth - Arna Softech
Guide to Food Delivery App Development.pdf
The Dynamic Duo Transforming Financial Accounting Systems Through Modern Expe...
4Seller: The All-in-One Multi-Channel E-Commerce Management Platform for Glob...
How to Odoo 19 Installation on Ubuntu - CandidRoot
iTop VPN Crack Latest Version Full Key 2025
Lecture 5 Software Requirement Engineering
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
Practical Indispensable Project Management Tips for Delivering Successful Exp...
Full-Stack Developer Courses That Actually Land You Jobs
Cybersecurity-and-Fraud-Protecting-Your-Digital-Life.pptx
Download Adobe Photoshop Crack 2025 Free
Introduction to Windows Operating System
UTEP毕业证学历认证,宾夕法尼亚克拉里恩大学毕业证未毕业
Modern SharePoint Intranet Templates That Boost Employee Engagement in 2025.docx
Workplace Software and Skills - OpenStax
DuckDuckGo Private Browser Premium APK for Android Crack Latest 2025
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
Airline CRS | Airline CRS Systems | CRS System
Microsoft Office 365 Crack Download Free

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