SlideShare a Scribd company logo
Angular IO Overview
Jennifer Jirka
Web Application Development SIG
Software Engineering TC
Jennifer Jirka
• Senior Consultant, with Avanade for 4.5 years
• Web Application Development SIG Lead
• 6 years of experience with JavaScript web
development
• 3 years of experience with Angular JS
• Project experience with Angular IO
• I love writing and speaking about Angular
• Personal career goals focus on teaching and
mentoring
• 6 month old junior analyst developer at home
Agenda
• Foundational Concepts
• TypeScript
• Components
• Putting It All Together
• Angular CLI
Foundational Concepts

Recommended for you

Angular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesAngular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP Services

Http Service will help us fetch external data, post to it, etc. We need to import the http module to make use of the http service. Let us consider an example to understand how to make use of the http service.

angularwebstack academy bangalorefullstack web developer
Introduction to angular with a simple but complete project
Introduction to angular with a simple but complete projectIntroduction to angular with a simple but complete project
Introduction to angular with a simple but complete project

Angular is a framework for building client applications in HTML, CSS and TypeScript. It provides best practices like modularity, separation of concerns and testability for client-side development. The document discusses creating an Angular project, generating components, binding data, using directives, communicating with backend services, routing between components and building for production. Key steps include generating components, services and modules, binding data, calling REST APIs, defining routes and building the app.

angular
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...

This document outlines an AngularJS certification training agenda that covers directives. It defines directives as classes that extend HTML and transform the DOM. There are three types of directives: components, structural directives, and attribute directives. Built-in directives like NgFor and NgIf are covered, which add and remove elements. The document demonstrates how to create a custom attribute directive by using the @Directive decorator and accessing native DOM elements.

edurekaangular directives advanceangularjs custom directives
What is Angular IO?
• Angular IO is a framework for object oriented web development of
single page web applications.
• It is not an MVC framework, but rather a component-based
framework.
• An Angular IO application is a tree of loosely coupled components.
• Components are custom HTML elements, which couple structure
with functionality.
• Using custom HTML elements, developers can create a web app
declaratively.
Review: Single Page Applications
Web 1.0
Web 2.0
SPA
AJAX
Single Page Applications render HTML to the browser once and subsequent communication is AJAX.
Server sends
static pages.
Fond memories: Angular JS
• Angular JS is a JavaScript framework which allows the user to create custom
HTML elements which couple structure and function.
• Angular JS databinding is built on JavaScript variable scope, and can get
confusing.
• The bootstrap process in Angular JS is based on the ng-app framework HTML
directive.
• Angular JS architecture uses directives and controllers.
New Platform: Angular IO
• Angular IO is a TypeScript-based web development platform.
• Angular IO is a complete rewrite of Angular JS.
• Angular IO uses a hierarchy of components for databinding and scope, which is
significantly simplified from Angular JS.
• Angular IO supports named dependency injection.
• Angular IO is compatible with RxJS reactive programming.
• Convention: “Angular” == Angular 2.x, Angular IO
“Angular JS” == Angular 1.x

Recommended for you

Angular introduction students
Angular introduction studentsAngular introduction students
Angular introduction students

Angular is a platform for building applications with templates, dependency injection, and integrated tools. It contains modules, components, directives, routing, and services as building blocks. Modules contain routes, components, directives, and services. Components form part of the DOM tree. Directives attach behavior to DOM elements. Routing enables navigation between views. Services provide business logic and data access. The Angular CLI is used to generate, develop, and maintain Angular applications.

feu techangular 6angular intro
Angular 8
Angular 8 Angular 8
Angular 8

This document provides an overview of Angular, including: - Angular is a JavaScript framework used to build client-side applications with HTML. Code is written in TypeScript which compiles to JavaScript. - Angular enhances HTML with directives, data binding, and dependency injection. It follows an MVC architecture internally. - Components are the basic building blocks of Angular applications. Modules contain components and services. Services contain reusable business logic. - The document discusses Angular concepts like modules, components, data binding, services, routing and forms. It provides examples of creating a sample login/welcome application in Angular.

angular8sunil sahusunios
WSA : Web Application Development Courses
WSA : Web Application Development CoursesWSA : Web Application Development Courses
WSA : Web Application Development Courses

Webstack Academy is a new age IT finishing school offering best in class courses in Web and Application development. Our FullStack development courses (mainly based on MEAN stack) provides excellent hands-on approach to enable you get started with your first job. It also maintains a very good balance with foundations so that your learning is complete. Here is a presentation which talks about WSA.

mean stackweb application developmentoops
Angular IO is based on Components
• Apps built with Angular IO are defined by a tree of components
• The base of the tree is a root component
• Entire DOM cascades from the root component
TypeScript
TypeScript is a Superset of JavaScript
• TypeScript is a strongly typed superset of JavaScript.
• .TS files get compiled to .JS files using a TypeScript compiler.
• The Angular CLI compiles TypeScript in an Angular app (more on this
later)
You can install a simple TypeScript compiler with NPM:
npm install –g typescript
Why switch to TypeScript?
(Skipping TypeScript fundamentals for this talk)
• JavaScript built from TypeScript is significantly faster, at the expense of human
readability.
• TypeScript strong inline types and decorators add the most run-time efficiency.
• The authors of Angular JS used a JavaScript optimizer called the Closure Compiler
which builds down JavaScript into similar output.
• The Closure Compiler influenced the decision to move Angular IO to TypeScript
You can download the Closure Compiler if you are curious here:
https://github.com/google/closure-compiler-js

Recommended for you

Angular
AngularAngular
Angular

This document discusses Angular components, dependency injection, and routing. It defines Angular as being built on modules, components, templates, and services. Components are the basic building blocks and make up a hierarchical tree structure. Dependency injection allows components to access services. Routing in Angular uses a router to navigate between views and components based on URL changes.

angulartypescript
Angular
AngularAngular
Angular

Angular is an open-source TypeScript-based front-end web application platform maintained by Google. It uses MVC and dependency injection patterns. Key features include components, services, routing and calling remote services. Version 1 was released in 2009 as AngularJS and the latest version is Angular 5. It is used to build large web applications and sites like Google and Uber.

angularjavascript
Angular - Chapter 5 - Directives
 Angular - Chapter 5 - Directives Angular - Chapter 5 - Directives
Angular - Chapter 5 - Directives

A directive is a custom HTML element that is used to extend the power of HTML. Angular 2 has the following directives that get called as part of the BrowserModule module. ngif ngFor If you view the app.module.ts file, you will see the following code and the BrowserModule module defined. By defining this module, you will have access to the 2 directives.

angularwebstack academy bangalorefullstack web developer
TypeScript Decorators
• A Decorator can be attached to a class declaration, method, accessor, property, or
parameter.
• Decorators use the form @expression, where expression must evaluate to a
function that will be called at runtime
Example: the @Inject decorator.
Inject is defined in the Angular framework and is used to inject named
dependencies
export class HeroComponent {
constructor(@Inject('heroName') private name: string) { }
}
Components
Remember, Angular IO is based on Components
• Apps built with Angular IO are defined by a tree of components
• The base of the tree is a root component
• Entire DOM cascades from the root component
Components couple structure and function
• A component is a TypeScript object class which uses the
@Component decorator to tell Angular that it defines a component.
• Use the @Component metadata to add properties including the
HTML template where the structure is defined.
• Add members to the object class to define functionality.
• Call member functions on events defined in HTML template
• Use object class constructor and member functions to work with data
/* You need to add new component to modules using @NgModule
(more on this later) */

Recommended for you

Angular tutorial
Angular tutorialAngular tutorial
Angular tutorial

A simple tutorial for understanding the basics of angular JS. Very useful for the beginners. Also useful for the quick revision. Very attractive design for the tutorial of angular js.

angular js tutorialangular basicsangularjs for beginners
Angular 10 course_content
Angular 10 course_contentAngular 10 course_content
Angular 10 course_content

The document outlines an online training course for Angular 10 that covers fundamental concepts like TypeScript, Angular fundamentals, NgRx, server-side integration with Node and Express, Angular Material, PrimeNG, and a final e-commerce project. The 50-day, 100-hour course includes daily live and hands-on training, video lessons, project files, and lifetime access for 6000 INR or $85. Key topics include Angular architecture, components, routing, HTTP requests, reactive forms, state management with NgRx, REST APIs, authentication, and deployment.

angular 10angular trainingangular
Angular 16 – the rise of Signals
Angular 16 – the rise of SignalsAngular 16 – the rise of Signals
Angular 16 – the rise of Signals

Angular 16 is the biggest release since the initial rollout of Angular, and it changes everything: Bye bye zones, change-detection, life-cycle, children-selectors, Rx and what not. Recorded webinar based on these slides given by Yaron Biton, Misterbit Coding-Academy’s CTO, can be found at: https://www.youtube.com/watch?v=92K1fgPbku8 Coding-Academy offers advanced web-techs training and software development services: Top-rated Full-stack courses for Angular, React, Vue, Node, Modern architectures, etc. | Available top-notch on-demand-coders trough Misterbit technological solutions | Coding-Academy Bootcamp: Hundreds of employed full-stack developers every year | Anything web, end to end projects | Tech companies and startups | Consulting to management and dev teams | Workshops for managers and leaders.

coding academymisterbitקודינג אקדמי
Example Component
import { Component, Input } from '@angular/core';
import { Hero } from './hero';
@Component({
selector: 'hero-detail',
template: `
<div *ngIf="hero">
<h2>{{hero.name}} details!</h2>
<div>
<label>name: </label>
<input [(ngModel)]="hero.name" placeholder="name"/>
</div>
</div>`
})
export class HeroDetailComponent {
@Input() hero: Hero;
}
Import statements make other exported
and platform classes available
Use @Component decorator to add metadata.
The selector attribute specifies the custom HTML tag which
declares your component
Match the component class name in UpperCamelCase to the
class name in lower-dash-case
The template can show inline HTML
or point to a file
Use @Input decorator to bind local variables to
data models.
Export your class so other modules cam import it.
Code Modules and AppModule
• Modules organize code into functional units.
• Modules are loosely analogous to namespaces in C style languages.
• Organize all modules in a tree structure, with the root module called
AppModule at the root.
• By convention, define AppModule in app.module.ts.
• AppModule should contain a reference to your base component, called
AppComponent by convention.
Root AppModule Example
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
@NgModule({
imports: [ BrowserModule ],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
Import AppComponent,
where base component is
defined.
Use NgModule decorator to
declare modules
Very Basic Angular App
src/app/app.module.ts
import { NgModule } from '@angular/core';
import { BrowserModule } from
'@angular/platform-browser';
import { AppComponent } from
'./app.component';
@NgModule({
imports: [ BrowserModule ],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
src/app/app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: '<h1>{{title}}</h1>',
})
export class AppComponent {
title = 'Minimal NgModule';
}

Recommended for you

Angular - Chapter 4 - Data and Event Handling
 Angular - Chapter 4 - Data and Event Handling Angular - Chapter 4 - Data and Event Handling
Angular - Chapter 4 - Data and Event Handling

The document provides information about Angular data binding and event handling. It discusses how interpolation can be used to connect data from a component class to its template. It also explains how property binding and event binding allow two-way communication between the component class and template. Finally, it introduces ngModel for setting up two-way data binding between an input element and a property.

angularwebstack academy bangalorefullstack web developer
Angular 5 presentation for beginners
Angular 5 presentation for beginnersAngular 5 presentation for beginners
Angular 5 presentation for beginners

An Open-Source JavaScript Framework It’s used to build Single Page based Web Application (SPA) Developed by Google, Release date March 2017, Current version 4.4.6 (stable).

angularangular 5angular 6
Angular Directives
Angular DirectivesAngular Directives
Angular Directives

The document summarizes Angular directives including ngIf, ngFor, ngSwitchCase, ngClass, and ngStyle. It describes how ngIf and ngFor are structural directives that change the DOM layout by adding and removing elements. NgIf and ngFor use an asterisk syntax that gets desugared into <ng-template> elements. NgFor iterates over collections and supports additional syntax like trackBy. NgSwitch is a set of cooperating directives that displays different elements based on a switch expression. NgClass and ngStyle are attribute directives that update CSS classes and styles on elements.

angularangular directivves
Putting it All Together Into a Web App
Simple JiT Bootstrapping
• An application is launched by bootstrapping its root module (AppModule)
• The main entry point of the application is main.ts, which contains a statement like below.
Angular loads this first.
import { AppModule } from './app/app.module';
• Index.html should contain an app HTML element. <app></app>
• Launch your application by adding a bootstrap statement to main.ts:
platformBrowserDynamic().bootstrapModule(AppModule);
• The Angular framework renders AppComponent on the app HTML element and the component
tree will cascade from here.
Bootstrap Process: Putting it all Together
0. Angular uses a bootstrap statement defined in main.ts to launch the application
as discussed above.
1. On document.ready, the Angular framework looks for a root module defined in
your main.ts file using a statement like this:
import { AppModule } from './app/app.module';
2. The framework also looks for a root component defined in your app.module.ts
file. You will find a statement like this:
export class AppModule { }
3. Your AppModule class should contain an import statement pointing to your base
app component like this:
import { AppComponent } from './app.component';
4. When the AppComponent is loaded, it is applied to the <app> HTML element in
index.html.
Anatomy of an
Angular App

Recommended for you

Angular routing
Angular routingAngular routing
Angular routing

The document discusses Angular routing and provides an example implementation. It first generates components for home, about, userList and user pages. It then sets up routes in app.module.ts to link URLs like /home and /about to their corresponding components. Navigation links using routerLink are added. To handle empty/invalid URLs, a default route is set to redirect to /home. Sub-routes are created under /user linking /user/list to UserListComponent, which displays a list of users. Clicking a user name creates a child route passing the name as a parameter to the UserComponent to display that user's details page.

angularfront-end programmingrouting
Angular 2 Essential Training
Angular 2 Essential Training Angular 2 Essential Training
Angular 2 Essential Training

Learn all the essentials of building Angular 2 applications right here. https://www.udemy.com/angular-2-training/?couponCode=UANGULAR2 This is a beginner level course aimed at those new to Angular 2 and Typescript. No previous knowledge of either is required before starting this course. This course combines slides, projects and quizzes in a clear, concise and engaging way to guide you through the core concepts of Angular 2 and Typescript. You will gain a solid foundation for building real-world applications following best practices and the Angular 2 style guide. This includes how to build components, create shared services, navigate between views, manage data, and managing user and system events.

softwarecodingengineering
Angular kickstart slideshare
Angular kickstart   slideshareAngular kickstart   slideshare
Angular kickstart slideshare

Angular Kickstart document provides an overview of Angular including: - Angular is a client side JavaScript framework that allows building of single page applications. - A single page application loads initial content via the first page load and subsequent content without reloading the page. - The document discusses Angular features such as modularity, performance, TypeScript support, and building blocks like modules, components and directives. It also provides instructions on setting up the development environment for Angular applications.

angularangular kickstartangular 2
Angular CLI
Angular Command Line Interface Tool
The Angular CLI is a Command Line Interface (CLI) to automate your
development workflow.
The Angular CLI allows you to:
• Create a new Angular application
• Run a development server with LiveReload support to preview your
application during development
• Add features to your existing Angular application
• Run your application’s unit tests
• Run your application’s end-to-end (E2E) tests
• Build your application for deployment to production
Angular CLI makes Angular easier
The Angular CLI streamlines the workflow for creating and building your app.
You can use the CLI to set up the basic structure files which we discussed
above.
The CLI can even set up a basic WebPack server for you so you can serve
your new app right away.
Once you have Node.js installed, you can install the Angular CLI to get up and
running quickly with Angular here:
https://github.com/angular/angular-cli
Get Started with a basic Angular App
1. Open a command prompt. Use your favorite way to install Node.js
globally.
2. Install the Angular CLI using npm install -g angular-cli
3. Find a working directory and switch to it. Think of a catchy name
for your new project.
4. Run ng new catchyNameHere
5. Run ng build
6. Run ng serve

Recommended for you

An Overview of Angular 4
An Overview of Angular 4 An Overview of Angular 4
An Overview of Angular 4

Angular is an open source JavaScript framework that is used to build single page based web applications.A detailed overview of Angular 4, Its features, development environment and components.

angular developmentangular jsangular development services
mean stack
mean stackmean stack
mean stack

Angular is an open-source JavaScript framework for building mobile and desktop web applications. It uses TypeScript for development and focuses on building single page applications. The key aspects of Angular include components, modules, templates and data binding. To set up an Angular application, developers must install Node.js, Angular CLI and configure the development environment. The Angular CLI is used to generate components, run tests and deploy applications. Components and modules are fundamental building blocks - components define views and logic, while modules organize an application's components. Data binding in templates connects application data and DOM elements.

mean stack
Angular Basics.pptx
Angular Basics.pptxAngular Basics.pptx
Angular Basics.pptx

Angular is a platform and framework for building single-page client applications using HTML and TypeScript. The basic building blocks of Angular include components, modules, directives, decorators, pipes, data binding, templates, and services. Components define views with templates and logic. Modules organize related code. Directives modify DOM elements. Decorators add metadata. Pipes transform data. Data binding syncs data and UI. Templates define views. Services provide reusable functionality.

angular
Useful Links
Selected Sources
1. https://angular.io/guide/architecture
2. http://www.eclipse.org/community/eclipse_newsletter/2017/january/article1.php
3. https://github.com/angular/angular-cli
4. https://angular.io/guide/ts-to-js
5. https://medium.com/dev-channel/closure-compiler-for-js-fun-and-profit-
3b6c99f4fd31
6. https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html
7. https://toddmotto.com/creating-your-first-angular-2-component
8. https://scotch.io/tutorials/creating-your-first-angular-2-components
9. https://toddmotto.com/bootstrap-angular-2-hello-world
10. https://angular.io/guide/webpack
11. https://angular.io/guide/ajs-quick-reference

More Related Content

What's hot

Angular Data Binding
Angular Data BindingAngular Data Binding
Angular Data Binding
Jennifer Estrada
 
Angular
AngularAngular
Angular - Chapter 1 - Introduction
 Angular - Chapter 1 - Introduction Angular - Chapter 1 - Introduction
Angular - Chapter 1 - Introduction
WebStackAcademy
 
Angular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesAngular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP Services
WebStackAcademy
 
Introduction to angular with a simple but complete project
Introduction to angular with a simple but complete projectIntroduction to angular with a simple but complete project
Introduction to angular with a simple but complete project
Jadson Santos
 
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
Edureka!
 
Angular introduction students
Angular introduction studentsAngular introduction students
Angular introduction students
Christian John Felix
 
Angular 8
Angular 8 Angular 8
Angular 8
Sunil OS
 
WSA : Web Application Development Courses
WSA : Web Application Development CoursesWSA : Web Application Development Courses
WSA : Web Application Development Courses
WebStackAcademy
 
Angular
AngularAngular
Angular
Lilia Sfaxi
 
Angular
AngularAngular
Angular
khoado2002
 
Angular - Chapter 5 - Directives
 Angular - Chapter 5 - Directives Angular - Chapter 5 - Directives
Angular - Chapter 5 - Directives
WebStackAcademy
 
Angular tutorial
Angular tutorialAngular tutorial
Angular tutorial
Rohit Gupta
 
Angular 10 course_content
Angular 10 course_contentAngular 10 course_content
Angular 10 course_content
NAVEENSAGGAM1
 
Angular 16 – the rise of Signals
Angular 16 – the rise of SignalsAngular 16 – the rise of Signals
Angular 16 – the rise of Signals
Coding Academy
 
Angular - Chapter 4 - Data and Event Handling
 Angular - Chapter 4 - Data and Event Handling Angular - Chapter 4 - Data and Event Handling
Angular - Chapter 4 - Data and Event Handling
WebStackAcademy
 
Angular 5 presentation for beginners
Angular 5 presentation for beginnersAngular 5 presentation for beginners
Angular 5 presentation for beginners
Imran Qasim
 
Angular Directives
Angular DirectivesAngular Directives
Angular Directives
iFour Technolab Pvt. Ltd.
 
Angular routing
Angular routingAngular routing
Angular routing
Sultan Ahmed
 
Angular 2 Essential Training
Angular 2 Essential Training Angular 2 Essential Training
Angular 2 Essential Training
Patrick Schroeder
 

What's hot (20)

Angular Data Binding
Angular Data BindingAngular Data Binding
Angular Data Binding
 
Angular
AngularAngular
Angular
 
Angular - Chapter 1 - Introduction
 Angular - Chapter 1 - Introduction Angular - Chapter 1 - Introduction
Angular - Chapter 1 - Introduction
 
Angular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesAngular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP Services
 
Introduction to angular with a simple but complete project
Introduction to angular with a simple but complete projectIntroduction to angular with a simple but complete project
Introduction to angular with a simple but complete project
 
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
 
Angular introduction students
Angular introduction studentsAngular introduction students
Angular introduction students
 
Angular 8
Angular 8 Angular 8
Angular 8
 
WSA : Web Application Development Courses
WSA : Web Application Development CoursesWSA : Web Application Development Courses
WSA : Web Application Development Courses
 
Angular
AngularAngular
Angular
 
Angular
AngularAngular
Angular
 
Angular - Chapter 5 - Directives
 Angular - Chapter 5 - Directives Angular - Chapter 5 - Directives
Angular - Chapter 5 - Directives
 
Angular tutorial
Angular tutorialAngular tutorial
Angular tutorial
 
Angular 10 course_content
Angular 10 course_contentAngular 10 course_content
Angular 10 course_content
 
Angular 16 – the rise of Signals
Angular 16 – the rise of SignalsAngular 16 – the rise of Signals
Angular 16 – the rise of Signals
 
Angular - Chapter 4 - Data and Event Handling
 Angular - Chapter 4 - Data and Event Handling Angular - Chapter 4 - Data and Event Handling
Angular - Chapter 4 - Data and Event Handling
 
Angular 5 presentation for beginners
Angular 5 presentation for beginnersAngular 5 presentation for beginners
Angular 5 presentation for beginners
 
Angular Directives
Angular DirectivesAngular Directives
Angular Directives
 
Angular routing
Angular routingAngular routing
Angular routing
 
Angular 2 Essential Training
Angular 2 Essential Training Angular 2 Essential Training
Angular 2 Essential Training
 

Similar to Angular IO

Angular kickstart slideshare
Angular kickstart   slideshareAngular kickstart   slideshare
Angular kickstart slideshare
SaleemMalik52
 
An Overview of Angular 4
An Overview of Angular 4 An Overview of Angular 4
mean stack
mean stackmean stack
mean stack
michaelaaron25322
 
Angular Basics.pptx
Angular Basics.pptxAngular Basics.pptx
Angular Basics.pptx
AshokKumar616995
 
02 - Angular Structural Elements - 1.pdf
02 - Angular Structural Elements - 1.pdf02 - Angular Structural Elements - 1.pdf
02 - Angular Structural Elements - 1.pdf
BrunoOliveira631137
 
How Does Angular Work?
How Does Angular Work?How Does Angular Work?
How Does Angular Work?
Albiorix Technology
 
Angular - Chapter 3 - Components
Angular - Chapter 3 - ComponentsAngular - Chapter 3 - Components
Angular - Chapter 3 - Components
WebStackAcademy
 
Evolution and History of Angular as Web Development Platform.pdf
Evolution and History of Angular as Web Development Platform.pdfEvolution and History of Angular as Web Development Platform.pdf
Evolution and History of Angular as Web Development Platform.pdf
iFour Technolab Pvt. Ltd.
 
Angular meetup 2 2019-08-29
Angular meetup 2   2019-08-29Angular meetup 2   2019-08-29
Angular meetup 2 2019-08-29
Nitin Bhojwani
 
Angular2 with type script
Angular2 with type scriptAngular2 with type script
Angular2 with type script
Ravi Mone
 
Angular4 getting started
Angular4 getting startedAngular4 getting started
Angular4 getting started
TejinderMakkar
 
4 Anguadasdfasdasdfasdfsdfasdfaslar (1).pptx
4 Anguadasdfasdasdfasdfsdfasdfaslar (1).pptx4 Anguadasdfasdasdfasdfsdfasdfaslar (1).pptx
4 Anguadasdfasdasdfasdfsdfasdfaslar (1).pptx
tilejak773
 
better-apps-angular-2-day1.pdf and home
better-apps-angular-2-day1.pdf  and homebetter-apps-angular-2-day1.pdf  and home
better-apps-angular-2-day1.pdf and home
ChethanGowda886434
 
Angular js 2
Angular js 2Angular js 2
Angular js 2
Ran Wahle
 
Angular Interview Questions-PDF.pdf
Angular Interview Questions-PDF.pdfAngular Interview Questions-PDF.pdf
Angular Interview Questions-PDF.pdf
JohnLeo57
 
Valentine with Angular js - Introduction
Valentine with Angular js - IntroductionValentine with Angular js - Introduction
Valentine with Angular js - Introduction
Senthil Kumar
 
Angular.ppt
Angular.pptAngular.ppt
Angular.ppt
Mytrux1
 
Angular
AngularAngular
Angular 2.0
Angular  2.0Angular  2.0
Angular 2.0
Mallikarjuna G D
 
Angular Best Practices To Build Clean and Performant Web Applications
Angular Best Practices To Build Clean and Performant Web ApplicationsAngular Best Practices To Build Clean and Performant Web Applications
Angular Best Practices To Build Clean and Performant Web Applications
Albiorix Technology
 

Similar to Angular IO (20)

Angular kickstart slideshare
Angular kickstart   slideshareAngular kickstart   slideshare
Angular kickstart slideshare
 
An Overview of Angular 4
An Overview of Angular 4 An Overview of Angular 4
An Overview of Angular 4
 
mean stack
mean stackmean stack
mean stack
 
Angular Basics.pptx
Angular Basics.pptxAngular Basics.pptx
Angular Basics.pptx
 
02 - Angular Structural Elements - 1.pdf
02 - Angular Structural Elements - 1.pdf02 - Angular Structural Elements - 1.pdf
02 - Angular Structural Elements - 1.pdf
 
How Does Angular Work?
How Does Angular Work?How Does Angular Work?
How Does Angular Work?
 
Angular - Chapter 3 - Components
Angular - Chapter 3 - ComponentsAngular - Chapter 3 - Components
Angular - Chapter 3 - Components
 
Evolution and History of Angular as Web Development Platform.pdf
Evolution and History of Angular as Web Development Platform.pdfEvolution and History of Angular as Web Development Platform.pdf
Evolution and History of Angular as Web Development Platform.pdf
 
Angular meetup 2 2019-08-29
Angular meetup 2   2019-08-29Angular meetup 2   2019-08-29
Angular meetup 2 2019-08-29
 
Angular2 with type script
Angular2 with type scriptAngular2 with type script
Angular2 with type script
 
Angular4 getting started
Angular4 getting startedAngular4 getting started
Angular4 getting started
 
4 Anguadasdfasdasdfasdfsdfasdfaslar (1).pptx
4 Anguadasdfasdasdfasdfsdfasdfaslar (1).pptx4 Anguadasdfasdasdfasdfsdfasdfaslar (1).pptx
4 Anguadasdfasdasdfasdfsdfasdfaslar (1).pptx
 
better-apps-angular-2-day1.pdf and home
better-apps-angular-2-day1.pdf  and homebetter-apps-angular-2-day1.pdf  and home
better-apps-angular-2-day1.pdf and home
 
Angular js 2
Angular js 2Angular js 2
Angular js 2
 
Angular Interview Questions-PDF.pdf
Angular Interview Questions-PDF.pdfAngular Interview Questions-PDF.pdf
Angular Interview Questions-PDF.pdf
 
Valentine with Angular js - Introduction
Valentine with Angular js - IntroductionValentine with Angular js - Introduction
Valentine with Angular js - Introduction
 
Angular.ppt
Angular.pptAngular.ppt
Angular.ppt
 
Angular
AngularAngular
Angular
 
Angular 2.0
Angular  2.0Angular  2.0
Angular 2.0
 
Angular Best Practices To Build Clean and Performant Web Applications
Angular Best Practices To Build Clean and Performant Web ApplicationsAngular Best Practices To Build Clean and Performant Web Applications
Angular Best Practices To Build Clean and Performant Web Applications
 

Recently uploaded

Migrate your Infrastructure to the AWS Cloud
Migrate your Infrastructure to the AWS CloudMigrate your Infrastructure to the AWS Cloud
Migrate your Infrastructure to the AWS Cloud
Ortus Solutions, Corp
 
Addressing the Top 9 User Pain Points with Visual Design Elements.pptx
Addressing the Top 9 User Pain Points with Visual Design Elements.pptxAddressing the Top 9 User Pain Points with Visual Design Elements.pptx
Addressing the Top 9 User Pain Points with Visual Design Elements.pptx
Sparity1
 
FAST Channels: Explosive Growth Forecast 2024-2027 (Buckle Up!)
FAST Channels: Explosive Growth Forecast 2024-2027 (Buckle Up!)FAST Channels: Explosive Growth Forecast 2024-2027 (Buckle Up!)
FAST Channels: Explosive Growth Forecast 2024-2027 (Buckle Up!)
Roshan Dwivedi
 
Break data silos with real-time connectivity using Confluent Cloud Connectors
Break data silos with real-time connectivity using Confluent Cloud ConnectorsBreak data silos with real-time connectivity using Confluent Cloud Connectors
Break data silos with real-time connectivity using Confluent Cloud Connectors
confluent
 
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdf
WhatsApp Tracker -  Tracking WhatsApp to Boost Online Safety.pdfWhatsApp Tracker -  Tracking WhatsApp to Boost Online Safety.pdf
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdf
onemonitarsoftware
 
Splunk_Remote_Work_Insights_Overview.pptx
Splunk_Remote_Work_Insights_Overview.pptxSplunk_Remote_Work_Insights_Overview.pptx
Splunk_Remote_Work_Insights_Overview.pptx
sudsdeep
 
What is OCR Technology and How to Extract Text from Any Image for Free
What is OCR Technology and How to Extract Text from Any Image for FreeWhat is OCR Technology and How to Extract Text from Any Image for Free
What is OCR Technology and How to Extract Text from Any Image for Free
TwisterTools
 
Safe Work Permit Management Software for Hot Work Permits
Safe Work Permit Management Software for Hot Work PermitsSafe Work Permit Management Software for Hot Work Permits
Safe Work Permit Management Software for Hot Work Permits
sheqnetworkmarketing
 
Discover the Power of ONEMONITAR: The Ultimate Mobile Spy App for Android Dev...
Discover the Power of ONEMONITAR: The Ultimate Mobile Spy App for Android Dev...Discover the Power of ONEMONITAR: The Ultimate Mobile Spy App for Android Dev...
Discover the Power of ONEMONITAR: The Ultimate Mobile Spy App for Android Dev...
onemonitarsoftware
 
dachnug51 - HCL Sametime 12 as a Software Appliance.pdf
dachnug51 - HCL Sametime 12 as a Software Appliance.pdfdachnug51 - HCL Sametime 12 as a Software Appliance.pdf
dachnug51 - HCL Sametime 12 as a Software Appliance.pdf
DNUG e.V.
 
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
ThousandEyes
 
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...
Hironori Washizaki
 
NYC 26-Jun-2024 Combined Presentations.pdf
NYC 26-Jun-2024 Combined Presentations.pdfNYC 26-Jun-2024 Combined Presentations.pdf
NYC 26-Jun-2024 Combined Presentations.pdf
AUGNYC
 
Leading Project Management Tool Taskruop.pptx
Leading Project Management Tool Taskruop.pptxLeading Project Management Tool Taskruop.pptx
Leading Project Management Tool Taskruop.pptx
taskroupseo
 
active-directory-auditing-solution (2).pptx
active-directory-auditing-solution (2).pptxactive-directory-auditing-solution (2).pptx
active-directory-auditing-solution (2).pptx
sudsdeep
 
dachnug51 - All you ever wanted to know about domino licensing.pdf
dachnug51 - All you ever wanted to know about domino licensing.pdfdachnug51 - All you ever wanted to know about domino licensing.pdf
dachnug51 - All you ever wanted to know about domino licensing.pdf
DNUG e.V.
 
Intro to Amazon Web Services (AWS) and Gen AI
Intro to Amazon Web Services (AWS) and Gen AIIntro to Amazon Web Services (AWS) and Gen AI
Intro to Amazon Web Services (AWS) and Gen AI
Ortus Solutions, Corp
 
MVP Mobile Application - Codearrest.pptx
MVP Mobile Application - Codearrest.pptxMVP Mobile Application - Codearrest.pptx
MVP Mobile Application - Codearrest.pptx
Mitchell Marsh
 
Development of Chatbot Using AI\ML Technologies
Development of Chatbot Using AI\ML TechnologiesDevelopment of Chatbot Using AI\ML Technologies
Development of Chatbot Using AI\ML Technologies
MaisnamLuwangPibarel
 
dachnug51 - Whats new in domino 14 .pdf
dachnug51 - Whats new in domino 14  .pdfdachnug51 - Whats new in domino 14  .pdf
dachnug51 - Whats new in domino 14 .pdf
DNUG e.V.
 

Recently uploaded (20)

Migrate your Infrastructure to the AWS Cloud
Migrate your Infrastructure to the AWS CloudMigrate your Infrastructure to the AWS Cloud
Migrate your Infrastructure to the AWS Cloud
 
Addressing the Top 9 User Pain Points with Visual Design Elements.pptx
Addressing the Top 9 User Pain Points with Visual Design Elements.pptxAddressing the Top 9 User Pain Points with Visual Design Elements.pptx
Addressing the Top 9 User Pain Points with Visual Design Elements.pptx
 
FAST Channels: Explosive Growth Forecast 2024-2027 (Buckle Up!)
FAST Channels: Explosive Growth Forecast 2024-2027 (Buckle Up!)FAST Channels: Explosive Growth Forecast 2024-2027 (Buckle Up!)
FAST Channels: Explosive Growth Forecast 2024-2027 (Buckle Up!)
 
Break data silos with real-time connectivity using Confluent Cloud Connectors
Break data silos with real-time connectivity using Confluent Cloud ConnectorsBreak data silos with real-time connectivity using Confluent Cloud Connectors
Break data silos with real-time connectivity using Confluent Cloud Connectors
 
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdf
WhatsApp Tracker -  Tracking WhatsApp to Boost Online Safety.pdfWhatsApp Tracker -  Tracking WhatsApp to Boost Online Safety.pdf
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdf
 
Splunk_Remote_Work_Insights_Overview.pptx
Splunk_Remote_Work_Insights_Overview.pptxSplunk_Remote_Work_Insights_Overview.pptx
Splunk_Remote_Work_Insights_Overview.pptx
 
What is OCR Technology and How to Extract Text from Any Image for Free
What is OCR Technology and How to Extract Text from Any Image for FreeWhat is OCR Technology and How to Extract Text from Any Image for Free
What is OCR Technology and How to Extract Text from Any Image for Free
 
Safe Work Permit Management Software for Hot Work Permits
Safe Work Permit Management Software for Hot Work PermitsSafe Work Permit Management Software for Hot Work Permits
Safe Work Permit Management Software for Hot Work Permits
 
Discover the Power of ONEMONITAR: The Ultimate Mobile Spy App for Android Dev...
Discover the Power of ONEMONITAR: The Ultimate Mobile Spy App for Android Dev...Discover the Power of ONEMONITAR: The Ultimate Mobile Spy App for Android Dev...
Discover the Power of ONEMONITAR: The Ultimate Mobile Spy App for Android Dev...
 
dachnug51 - HCL Sametime 12 as a Software Appliance.pdf
dachnug51 - HCL Sametime 12 as a Software Appliance.pdfdachnug51 - HCL Sametime 12 as a Software Appliance.pdf
dachnug51 - HCL Sametime 12 as a Software Appliance.pdf
 
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
 
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...
 
NYC 26-Jun-2024 Combined Presentations.pdf
NYC 26-Jun-2024 Combined Presentations.pdfNYC 26-Jun-2024 Combined Presentations.pdf
NYC 26-Jun-2024 Combined Presentations.pdf
 
Leading Project Management Tool Taskruop.pptx
Leading Project Management Tool Taskruop.pptxLeading Project Management Tool Taskruop.pptx
Leading Project Management Tool Taskruop.pptx
 
active-directory-auditing-solution (2).pptx
active-directory-auditing-solution (2).pptxactive-directory-auditing-solution (2).pptx
active-directory-auditing-solution (2).pptx
 
dachnug51 - All you ever wanted to know about domino licensing.pdf
dachnug51 - All you ever wanted to know about domino licensing.pdfdachnug51 - All you ever wanted to know about domino licensing.pdf
dachnug51 - All you ever wanted to know about domino licensing.pdf
 
Intro to Amazon Web Services (AWS) and Gen AI
Intro to Amazon Web Services (AWS) and Gen AIIntro to Amazon Web Services (AWS) and Gen AI
Intro to Amazon Web Services (AWS) and Gen AI
 
MVP Mobile Application - Codearrest.pptx
MVP Mobile Application - Codearrest.pptxMVP Mobile Application - Codearrest.pptx
MVP Mobile Application - Codearrest.pptx
 
Development of Chatbot Using AI\ML Technologies
Development of Chatbot Using AI\ML TechnologiesDevelopment of Chatbot Using AI\ML Technologies
Development of Chatbot Using AI\ML Technologies
 
dachnug51 - Whats new in domino 14 .pdf
dachnug51 - Whats new in domino 14  .pdfdachnug51 - Whats new in domino 14  .pdf
dachnug51 - Whats new in domino 14 .pdf
 

Angular IO

  • 1. Angular IO Overview Jennifer Jirka Web Application Development SIG Software Engineering TC
  • 2. Jennifer Jirka • Senior Consultant, with Avanade for 4.5 years • Web Application Development SIG Lead • 6 years of experience with JavaScript web development • 3 years of experience with Angular JS • Project experience with Angular IO • I love writing and speaking about Angular • Personal career goals focus on teaching and mentoring • 6 month old junior analyst developer at home
  • 3. Agenda • Foundational Concepts • TypeScript • Components • Putting It All Together • Angular CLI
  • 5. What is Angular IO? • Angular IO is a framework for object oriented web development of single page web applications. • It is not an MVC framework, but rather a component-based framework. • An Angular IO application is a tree of loosely coupled components. • Components are custom HTML elements, which couple structure with functionality. • Using custom HTML elements, developers can create a web app declaratively.
  • 6. Review: Single Page Applications Web 1.0 Web 2.0 SPA AJAX Single Page Applications render HTML to the browser once and subsequent communication is AJAX. Server sends static pages.
  • 7. Fond memories: Angular JS • Angular JS is a JavaScript framework which allows the user to create custom HTML elements which couple structure and function. • Angular JS databinding is built on JavaScript variable scope, and can get confusing. • The bootstrap process in Angular JS is based on the ng-app framework HTML directive. • Angular JS architecture uses directives and controllers.
  • 8. New Platform: Angular IO • Angular IO is a TypeScript-based web development platform. • Angular IO is a complete rewrite of Angular JS. • Angular IO uses a hierarchy of components for databinding and scope, which is significantly simplified from Angular JS. • Angular IO supports named dependency injection. • Angular IO is compatible with RxJS reactive programming. • Convention: “Angular” == Angular 2.x, Angular IO “Angular JS” == Angular 1.x
  • 9. Angular IO is based on Components • Apps built with Angular IO are defined by a tree of components • The base of the tree is a root component • Entire DOM cascades from the root component
  • 11. TypeScript is a Superset of JavaScript • TypeScript is a strongly typed superset of JavaScript. • .TS files get compiled to .JS files using a TypeScript compiler. • The Angular CLI compiles TypeScript in an Angular app (more on this later) You can install a simple TypeScript compiler with NPM: npm install –g typescript
  • 12. Why switch to TypeScript? (Skipping TypeScript fundamentals for this talk) • JavaScript built from TypeScript is significantly faster, at the expense of human readability. • TypeScript strong inline types and decorators add the most run-time efficiency. • The authors of Angular JS used a JavaScript optimizer called the Closure Compiler which builds down JavaScript into similar output. • The Closure Compiler influenced the decision to move Angular IO to TypeScript You can download the Closure Compiler if you are curious here: https://github.com/google/closure-compiler-js
  • 13. TypeScript Decorators • A Decorator can be attached to a class declaration, method, accessor, property, or parameter. • Decorators use the form @expression, where expression must evaluate to a function that will be called at runtime Example: the @Inject decorator. Inject is defined in the Angular framework and is used to inject named dependencies export class HeroComponent { constructor(@Inject('heroName') private name: string) { } }
  • 15. Remember, Angular IO is based on Components • Apps built with Angular IO are defined by a tree of components • The base of the tree is a root component • Entire DOM cascades from the root component
  • 16. Components couple structure and function • A component is a TypeScript object class which uses the @Component decorator to tell Angular that it defines a component. • Use the @Component metadata to add properties including the HTML template where the structure is defined. • Add members to the object class to define functionality. • Call member functions on events defined in HTML template • Use object class constructor and member functions to work with data /* You need to add new component to modules using @NgModule (more on this later) */
  • 17. Example Component import { Component, Input } from '@angular/core'; import { Hero } from './hero'; @Component({ selector: 'hero-detail', template: ` <div *ngIf="hero"> <h2>{{hero.name}} details!</h2> <div> <label>name: </label> <input [(ngModel)]="hero.name" placeholder="name"/> </div> </div>` }) export class HeroDetailComponent { @Input() hero: Hero; } Import statements make other exported and platform classes available Use @Component decorator to add metadata. The selector attribute specifies the custom HTML tag which declares your component Match the component class name in UpperCamelCase to the class name in lower-dash-case The template can show inline HTML or point to a file Use @Input decorator to bind local variables to data models. Export your class so other modules cam import it.
  • 18. Code Modules and AppModule • Modules organize code into functional units. • Modules are loosely analogous to namespaces in C style languages. • Organize all modules in a tree structure, with the root module called AppModule at the root. • By convention, define AppModule in app.module.ts. • AppModule should contain a reference to your base component, called AppComponent by convention.
  • 19. Root AppModule Example import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './app.component'; @NgModule({ imports: [ BrowserModule ], declarations: [ AppComponent ], bootstrap: [ AppComponent ] }) export class AppModule { } Import AppComponent, where base component is defined. Use NgModule decorator to declare modules
  • 20. Very Basic Angular App src/app/app.module.ts import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './app.component'; @NgModule({ imports: [ BrowserModule ], declarations: [ AppComponent ], bootstrap: [ AppComponent ] }) export class AppModule { } src/app/app.component.ts import { Component } from '@angular/core'; @Component({ selector: 'my-app', template: '<h1>{{title}}</h1>', }) export class AppComponent { title = 'Minimal NgModule'; }
  • 21. Putting it All Together Into a Web App
  • 22. Simple JiT Bootstrapping • An application is launched by bootstrapping its root module (AppModule) • The main entry point of the application is main.ts, which contains a statement like below. Angular loads this first. import { AppModule } from './app/app.module'; • Index.html should contain an app HTML element. <app></app> • Launch your application by adding a bootstrap statement to main.ts: platformBrowserDynamic().bootstrapModule(AppModule); • The Angular framework renders AppComponent on the app HTML element and the component tree will cascade from here.
  • 23. Bootstrap Process: Putting it all Together 0. Angular uses a bootstrap statement defined in main.ts to launch the application as discussed above. 1. On document.ready, the Angular framework looks for a root module defined in your main.ts file using a statement like this: import { AppModule } from './app/app.module'; 2. The framework also looks for a root component defined in your app.module.ts file. You will find a statement like this: export class AppModule { } 3. Your AppModule class should contain an import statement pointing to your base app component like this: import { AppComponent } from './app.component'; 4. When the AppComponent is loaded, it is applied to the <app> HTML element in index.html.
  • 26. Angular Command Line Interface Tool The Angular CLI is a Command Line Interface (CLI) to automate your development workflow. The Angular CLI allows you to: • Create a new Angular application • Run a development server with LiveReload support to preview your application during development • Add features to your existing Angular application • Run your application’s unit tests • Run your application’s end-to-end (E2E) tests • Build your application for deployment to production
  • 27. Angular CLI makes Angular easier The Angular CLI streamlines the workflow for creating and building your app. You can use the CLI to set up the basic structure files which we discussed above. The CLI can even set up a basic WebPack server for you so you can serve your new app right away. Once you have Node.js installed, you can install the Angular CLI to get up and running quickly with Angular here: https://github.com/angular/angular-cli
  • 28. Get Started with a basic Angular App 1. Open a command prompt. Use your favorite way to install Node.js globally. 2. Install the Angular CLI using npm install -g angular-cli 3. Find a working directory and switch to it. Think of a catchy name for your new project. 4. Run ng new catchyNameHere 5. Run ng build 6. Run ng serve
  • 30. Selected Sources 1. https://angular.io/guide/architecture 2. http://www.eclipse.org/community/eclipse_newsletter/2017/january/article1.php 3. https://github.com/angular/angular-cli 4. https://angular.io/guide/ts-to-js 5. https://medium.com/dev-channel/closure-compiler-for-js-fun-and-profit- 3b6c99f4fd31 6. https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html 7. https://toddmotto.com/creating-your-first-angular-2-component 8. https://scotch.io/tutorials/creating-your-first-angular-2-components 9. https://toddmotto.com/bootstrap-angular-2-hello-world 10. https://angular.io/guide/webpack 11. https://angular.io/guide/ajs-quick-reference