(Go: >> BACK << -|- >> HOME <<)

SlideShare a Scribd company logo
Angular (Session - 2)
Nitin Bhojwani nbhojwani@vmware.com
Saket Singh sakets@vmware.com
Nikhil Gupta guptanikhil@vmware.com
Agenda
• Recap of the last talk
“Angular Workshop – 1 (Getting started with Angular)”
• Angular Component Lifecycle
• Modularizing Angular application – How to do and benefits of it
• Angular Routing – Routing in UI
• Hands On
• Essential Code guidelines from Angular Style Guide
Recap
Recap - Angular
• Angular helps you build modern applications for the web, mobile, or
desktop.
• Reusability
• Components( a small patch of screen) are reusable – build once use
everywhere.
• Develop Across all platforms – Desktop, Mobile and others
• Speed and Performance
• Build features quickly with simple, declarative templates
• https://angular.io/guide/architecture
Recap - Why Angular?
Single Page Application
• SPA is fast as most of the resources(HTML, CSS, JS) are only loaded
once throughout the lifespan of application.
• Data is loaded independently using REST apis
• Routing is handled in UI
• Simplified and streamlined
• More Control in UI – Less server involvement
Recap - Why Angular?
Accelerated DOM update
• Accessing DOM tree is costly
• Any runtime change in the page
requires a DOM update. DOM
update for every change will
slaughter performance.
• Optimize DOM updating process
and accelerate it.
Recap - Typescript
• .ts file extension
• JavaScript is Dynamically typed language
• Problematic in bigger projects
• TS provides static typing helps in development and preventing usual
bugs
• Superset of JavaScript
• Even JavaScript code works on Typescript.
• Object Oriented Programming
Recap - Angular Building Blocks
Component
• A component controls a patch of screen called a view.
• Presentation Logic goes here, can invoke based on user actions
• Define:
@Component({
selector: 'app-hero-list’,
templateUrl: './hero-list.component.html’,
providers: [ HeroService ] })
• Use:
<app-hero-list></app-hero-list>
• https://angular.io/guide/architecture-components
Recap - Angular Building Blocks
Service
• Includes any value, function, or feature that an app needs.
• A service is typically a class with a narrow, well-defined purpose.
• Should do something specific and do it well.
• Backend for view(Component)
• Handles functionality
Recap - Clarity Design System
• Open sourced by VMware
• UX guidelines,
HTML/CSS framework, and
Angular components
• Don’t work on view from scratch
• Reuse components provided by Clarity
• https://clarity.design/
Angular Component Lifecycle
Angular Component Lifecycle
• A component has a lifecycle managed by Angular.
• Creation
• Rendering
• Changes
• Destruction
• Makes it possible to execute code at different lifecycle events.
Lifecycle Hooks
ngOnChanges():
• Called before ngOnInit() and whenever one or more data-bound
input properties change.
• Code to react on input changes goes here.
ngOnInit():
• Called once, after the first ngOnChanges()
• Code to initialize component data, set initial values goes here.
ngAfterContentInit():
• Called after Angular projects external content into the component's view. (Stuff that
goes inside "ng-content" tags)
• Pieces of HTML that can be passed from parent and projected in a child component.
Lifecycle Hooks
ngAfterViewInit():
• Triggered after the child components have been instantiated.
• Allows for interaction between parent and child components. (ViewChild is assigned a
valued here)
ngOnDestroy():
• Triggered before a component is disposed.
• Should handle closing streams and disposing off everything active.
Example Lifecycle Event Flow
Modularizing Angular Applications
Modules... What? Who?
• Logical separation of a single monolithic codebase into distinct redistributable packages.
• NgModules can contain components, service providers, and other code files.
• It can import functionality that is exported from other NgModules, and export
selected functionality for use by other NgModules.
• It is independent of the rest of the project.
• Angular has its own modularity system called NgModules.
Modularizing Angular Applications
Why Modules?
• Clean code with proper separation of concern. Each module has a set functional
responsibility.
• Easier to work with since it inherently avoids spaghetti.
• Well defined inter module interaction. Module interfaces generally remain unchanged.
• Reusable across multiple projects.
• Allows for lazy loading of code within the app.
• Each module compiles to a different JS file.
• Few parts of code might not be required at all. No reason to fetch it all at once.
• Greatly reduces the time it takes to initially load the app.
Angular Routing (Demo)
Hands On
(Hands On) Refactoring from last hands-on
• https://github.com/tech-talky/wwc-weather
• After the last hands-on, some refactoring is done:
• weather-status – new feature module
• migrate app.component.html and app.component.ts content to another
component in the new module weather-status
• Basic routing
(Hands On) Bring Code Locally
• Clone the repo and start locally
• git clone https://github.com/tech-talky/wwc-weather
• cd wwc-weather
• npm install
• ng serve –port 5000
• Let’s go through the code
(Hands On) What to do next?
• Start with routing and modularizing
• Create another feature module with children routing and main components:
• forecasting – get new component added
• Configure routing:
• https://angular.io/guide/lazy-loading-ngmodules#routes-at-the-app-level
(Hands On) What to do next?
• Vertical Nav from Clarity
• https://clarity.design/documentation/vertical-nav/collapsible-nav/normal
• forecast.component.ts – main component of forecast module
• Add map component to forecast component
• https://angular-maps.com/guides/getting-started/
• Input to component – lat, long
• Output from component – any new marker on the map
• https://stackblitz.com/edit/angular-google-maps-demo
• Next – Based upon the output from above component get forecasting
Essential Coding Practices
- Separation of Concerns:
• Split into modules - Lazy load your modules depending on need.
• Rule of one – easy reading and maintenance, avoid dependency collisions
- Use services for reusable business logic
• Write small, pure functions
- Make reusable components
- Follow the style guide by Angular (https://angular.io/guide/styleguide)

More Related Content

What's hot

Developing Cross-Platform Web Apps with ASP.NET Core1.0
Developing Cross-Platform Web Apps with ASP.NET Core1.0Developing Cross-Platform Web Apps with ASP.NET Core1.0
Developing Cross-Platform Web Apps with ASP.NET Core1.0
EastBanc Tachnologies
 
Continuous delivery of danbury.io, Part 1
Continuous delivery of danbury.io, Part 1Continuous delivery of danbury.io, Part 1
Continuous delivery of danbury.io, Part 1
Brian Jackson
 
Building iOS app using meteor
Building iOS app using meteorBuilding iOS app using meteor
Building iOS app using meteor
Entrepreneur / Startup
 
ECS19 - Daniel Neumann - AZURE FUNCTIONS 2.0 - RUNNING SERVERLESS EVERYWHERE
ECS19 - Daniel Neumann - AZURE FUNCTIONS 2.0 - RUNNING SERVERLESS EVERYWHEREECS19 - Daniel Neumann - AZURE FUNCTIONS 2.0 - RUNNING SERVERLESS EVERYWHERE
ECS19 - Daniel Neumann - AZURE FUNCTIONS 2.0 - RUNNING SERVERLESS EVERYWHERE
European Collaboration Summit
 
Building mobile apps using meteorJS
Building mobile apps using meteorJSBuilding mobile apps using meteorJS
Building mobile apps using meteorJS
Entrepreneur / Startup
 
Motion design in FIori
Motion design in FIoriMotion design in FIori
Motion design in FIori
Roman Rommel
 
ATD9 2013 One ASP.NET
ATD9 2013 One ASP.NETATD9 2013 One ASP.NET
ATD9 2013 One ASP.NET
Hrvoje Hudoletnjak
 
Azure Functions in Action #CodePaLOUsa
Azure Functions in Action #CodePaLOUsaAzure Functions in Action #CodePaLOUsa
Azure Functions in Action #CodePaLOUsa
Baskar rao Dsn
 
Алексей Волков "Введение в React Native"
Алексей Волков "Введение в React Native"Алексей Волков "Введение в React Native"
Алексей Волков "Введение в React Native"
Fwdays
 
Angular universal
Angular universalAngular universal
Angular universal
Michael Haberman
 
White Paper : ASP.NET Core AngularJs 2 and Prime
White Paper : ASP.NET Core AngularJs 2 and PrimeWhite Paper : ASP.NET Core AngularJs 2 and Prime
White Paper : ASP.NET Core AngularJs 2 and Prime
Hamida Rebai Trabelsi
 
Scaling AngularJS: Enterprise SOA on the MEAN Stack (Responsive Web & Mobile)
Scaling AngularJS: Enterprise SOA on the MEAN Stack (Responsive Web & Mobile)Scaling AngularJS: Enterprise SOA on the MEAN Stack (Responsive Web & Mobile)
Scaling AngularJS: Enterprise SOA on the MEAN Stack (Responsive Web & Mobile)
Movel
 
Building Massive AngularJS Apps
Building Massive AngularJS AppsBuilding Massive AngularJS Apps
Building Massive AngularJS Apps
Gordon Bockus
 
Using and extending Alfresco Content Application
Using and extending Alfresco Content ApplicationUsing and extending Alfresco Content Application
Using and extending Alfresco Content Application
Denys Vuika
 
Creating a Comprehensive Social Media App Using Ionic and Phone Gap
Creating a Comprehensive Social Media App Using Ionic and Phone GapCreating a Comprehensive Social Media App Using Ionic and Phone Gap
Creating a Comprehensive Social Media App Using Ionic and Phone Gap
FITC
 
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!
 
ASP.NET 5 Overview
ASP.NET 5 OverviewASP.NET 5 Overview
ASP.NET 5 Overview
Shahed Chowdhuri
 
Skinny Framework 1.0.0
Skinny Framework 1.0.0Skinny Framework 1.0.0
Skinny Framework 1.0.0
Kazuhiro Sera
 
Get Started with ASP.NET Core Training, Tutorial - Beginner to Advance
Get Started with ASP.NET Core Training, Tutorial - Beginner to AdvanceGet Started with ASP.NET Core Training, Tutorial - Beginner to Advance
Get Started with ASP.NET Core Training, Tutorial - Beginner to Advance
Shailendra Chauhan
 
Angular js training in noida
Angular js training in noidaAngular js training in noida
Angular js training in noida
nihalsingh113
 

What's hot (20)

Developing Cross-Platform Web Apps with ASP.NET Core1.0
Developing Cross-Platform Web Apps with ASP.NET Core1.0Developing Cross-Platform Web Apps with ASP.NET Core1.0
Developing Cross-Platform Web Apps with ASP.NET Core1.0
 
Continuous delivery of danbury.io, Part 1
Continuous delivery of danbury.io, Part 1Continuous delivery of danbury.io, Part 1
Continuous delivery of danbury.io, Part 1
 
Building iOS app using meteor
Building iOS app using meteorBuilding iOS app using meteor
Building iOS app using meteor
 
ECS19 - Daniel Neumann - AZURE FUNCTIONS 2.0 - RUNNING SERVERLESS EVERYWHERE
ECS19 - Daniel Neumann - AZURE FUNCTIONS 2.0 - RUNNING SERVERLESS EVERYWHEREECS19 - Daniel Neumann - AZURE FUNCTIONS 2.0 - RUNNING SERVERLESS EVERYWHERE
ECS19 - Daniel Neumann - AZURE FUNCTIONS 2.0 - RUNNING SERVERLESS EVERYWHERE
 
Building mobile apps using meteorJS
Building mobile apps using meteorJSBuilding mobile apps using meteorJS
Building mobile apps using meteorJS
 
Motion design in FIori
Motion design in FIoriMotion design in FIori
Motion design in FIori
 
ATD9 2013 One ASP.NET
ATD9 2013 One ASP.NETATD9 2013 One ASP.NET
ATD9 2013 One ASP.NET
 
Azure Functions in Action #CodePaLOUsa
Azure Functions in Action #CodePaLOUsaAzure Functions in Action #CodePaLOUsa
Azure Functions in Action #CodePaLOUsa
 
Алексей Волков "Введение в React Native"
Алексей Волков "Введение в React Native"Алексей Волков "Введение в React Native"
Алексей Волков "Введение в React Native"
 
Angular universal
Angular universalAngular universal
Angular universal
 
White Paper : ASP.NET Core AngularJs 2 and Prime
White Paper : ASP.NET Core AngularJs 2 and PrimeWhite Paper : ASP.NET Core AngularJs 2 and Prime
White Paper : ASP.NET Core AngularJs 2 and Prime
 
Scaling AngularJS: Enterprise SOA on the MEAN Stack (Responsive Web & Mobile)
Scaling AngularJS: Enterprise SOA on the MEAN Stack (Responsive Web & Mobile)Scaling AngularJS: Enterprise SOA on the MEAN Stack (Responsive Web & Mobile)
Scaling AngularJS: Enterprise SOA on the MEAN Stack (Responsive Web & Mobile)
 
Building Massive AngularJS Apps
Building Massive AngularJS AppsBuilding Massive AngularJS Apps
Building Massive AngularJS Apps
 
Using and extending Alfresco Content Application
Using and extending Alfresco Content ApplicationUsing and extending Alfresco Content Application
Using and extending Alfresco Content Application
 
Creating a Comprehensive Social Media App Using Ionic and Phone Gap
Creating a Comprehensive Social Media App Using Ionic and Phone GapCreating a Comprehensive Social Media App Using Ionic and Phone Gap
Creating a Comprehensive Social Media App Using Ionic and Phone Gap
 
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...
 
ASP.NET 5 Overview
ASP.NET 5 OverviewASP.NET 5 Overview
ASP.NET 5 Overview
 
Skinny Framework 1.0.0
Skinny Framework 1.0.0Skinny Framework 1.0.0
Skinny Framework 1.0.0
 
Get Started with ASP.NET Core Training, Tutorial - Beginner to Advance
Get Started with ASP.NET Core Training, Tutorial - Beginner to AdvanceGet Started with ASP.NET Core Training, Tutorial - Beginner to Advance
Get Started with ASP.NET Core Training, Tutorial - Beginner to Advance
 
Angular js training in noida
Angular js training in noidaAngular js training in noida
Angular js training in noida
 

Similar to Angular meetup 2 2019-08-29

Angular 2.0
Angular  2.0Angular  2.0
Angular 2.0
Mallikarjuna G D
 
Angular 14.pptx
Angular 14.pptxAngular 14.pptx
Angular 14.pptx
MohaNedGhawar
 
Building Blocks of Angular 2 and ASP.NET Core
Building Blocks of Angular 2 and ASP.NET CoreBuilding Blocks of Angular 2 and ASP.NET Core
Building Blocks of Angular 2 and ASP.NET Core
Levi Fuller
 
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 2
Angular 2Angular 2
Angular IO
Angular IOAngular IO
Angular IO
Jennifer Estrada
 
Angular.ppt
Angular.pptAngular.ppt
Angular.ppt
Mytrux1
 
Angular vs react
Angular vs reactAngular vs react
Angular vs react
Infinijith Technologies
 
Valentine with Angular js - Introduction
Valentine with Angular js - IntroductionValentine with Angular js - Introduction
Valentine with Angular js - Introduction
Senthil Kumar
 
Angular 9
Angular 9 Angular 9
Angular 9
Raja Vishnu
 
Introduction to angular | Concepts and Environment setup
Introduction to angular | Concepts and Environment setupIntroduction to angular | Concepts and Environment setup
Introduction to angular | Concepts and Environment setup
Ansley Rodrigues
 
AngularJS Basics
AngularJS BasicsAngularJS Basics
AngularJS Basics
Nikita Shounewich
 
Foster - Getting started with Angular
Foster - Getting started with AngularFoster - Getting started with Angular
Foster - Getting started with Angular
MukundSonaiya1
 
26 top angular 8 interview questions to know in 2020 [www.full stack.cafe]
26 top angular 8 interview questions to know in 2020   [www.full stack.cafe]26 top angular 8 interview questions to know in 2020   [www.full stack.cafe]
26 top angular 8 interview questions to know in 2020 [www.full stack.cafe]
Alex Ershov
 
AngularJS One Day Workshop
AngularJS One Day WorkshopAngularJS One Day Workshop
AngularJS One Day Workshop
Shyam Seshadri
 
AngularJs (1.x) Presentation
AngularJs (1.x) PresentationAngularJs (1.x) Presentation
AngularJs (1.x) Presentation
Raghubir Singh
 
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.
 
Overview of the AngularJS framework
Overview of the AngularJS framework Overview of the AngularJS framework
Overview of the AngularJS framework
Yakov Fain
 
Angular
AngularAngular
Web worker in your angular application
Web worker in your angular applicationWeb worker in your angular application
Web worker in your angular application
Suresh Patidar
 

Similar to Angular meetup 2 2019-08-29 (20)

Angular 2.0
Angular  2.0Angular  2.0
Angular 2.0
 
Angular 14.pptx
Angular 14.pptxAngular 14.pptx
Angular 14.pptx
 
Building Blocks of Angular 2 and ASP.NET Core
Building Blocks of Angular 2 and ASP.NET CoreBuilding Blocks of Angular 2 and ASP.NET Core
Building Blocks of Angular 2 and ASP.NET Core
 
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 2
Angular 2Angular 2
Angular 2
 
Angular IO
Angular IOAngular IO
Angular IO
 
Angular.ppt
Angular.pptAngular.ppt
Angular.ppt
 
Angular vs react
Angular vs reactAngular vs react
Angular vs react
 
Valentine with Angular js - Introduction
Valentine with Angular js - IntroductionValentine with Angular js - Introduction
Valentine with Angular js - Introduction
 
Angular 9
Angular 9 Angular 9
Angular 9
 
Introduction to angular | Concepts and Environment setup
Introduction to angular | Concepts and Environment setupIntroduction to angular | Concepts and Environment setup
Introduction to angular | Concepts and Environment setup
 
AngularJS Basics
AngularJS BasicsAngularJS Basics
AngularJS Basics
 
Foster - Getting started with Angular
Foster - Getting started with AngularFoster - Getting started with Angular
Foster - Getting started with Angular
 
26 top angular 8 interview questions to know in 2020 [www.full stack.cafe]
26 top angular 8 interview questions to know in 2020   [www.full stack.cafe]26 top angular 8 interview questions to know in 2020   [www.full stack.cafe]
26 top angular 8 interview questions to know in 2020 [www.full stack.cafe]
 
AngularJS One Day Workshop
AngularJS One Day WorkshopAngularJS One Day Workshop
AngularJS One Day Workshop
 
AngularJs (1.x) Presentation
AngularJs (1.x) PresentationAngularJs (1.x) Presentation
AngularJs (1.x) Presentation
 
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
 
Overview of the AngularJS framework
Overview of the AngularJS framework Overview of the AngularJS framework
Overview of the AngularJS framework
 
Angular
AngularAngular
Angular
 
Web worker in your angular application
Web worker in your angular applicationWeb worker in your angular application
Web worker in your angular application
 

Recently uploaded

Interaction Latency: Square's User-Centric Mobile Performance Metric
Interaction Latency: Square's User-Centric Mobile Performance MetricInteraction Latency: Square's User-Centric Mobile Performance Metric
Interaction Latency: Square's User-Centric Mobile Performance Metric
ScyllaDB
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
Mark Billinghurst
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
Vijayananda Mohire
 
“Intel’s Approach to Operationalizing AI in the Manufacturing Sector,” a Pres...
“Intel’s Approach to Operationalizing AI in the Manufacturing Sector,” a Pres...“Intel’s Approach to Operationalizing AI in the Manufacturing Sector,” a Pres...
“Intel’s Approach to Operationalizing AI in the Manufacturing Sector,” a Pres...
Edge AI and Vision Alliance
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
BookNet Canada
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
shanthidl1
 
Hire a private investigator to get cell phone records
Hire a private investigator to get cell phone recordsHire a private investigator to get cell phone records
Hire a private investigator to get cell phone records
HackersList
 
Running a Go App in Kubernetes: CPU Impacts
Running a Go App in Kubernetes: CPU ImpactsRunning a Go App in Kubernetes: CPU Impacts
Running a Go App in Kubernetes: CPU Impacts
ScyllaDB
 
What's Next Web Development Trends to Watch.pdf
What's Next Web Development Trends to Watch.pdfWhat's Next Web Development Trends to Watch.pdf
What's Next Web Development Trends to Watch.pdf
SeasiaInfotech2
 
What Not to Document and Why_ (North Bay Python 2024)
What Not to Document and Why_ (North Bay Python 2024)What Not to Document and Why_ (North Bay Python 2024)
What Not to Document and Why_ (North Bay Python 2024)
Margaret Fero
 
K2G - Insurtech Innovation EMEA Award 2024
K2G - Insurtech Innovation EMEA Award 2024K2G - Insurtech Innovation EMEA Award 2024
K2G - Insurtech Innovation EMEA Award 2024
The Digital Insurer
 
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Chris Swan
 
Lessons Of Binary Analysis - Christien Rioux
Lessons Of Binary Analysis - Christien RiouxLessons Of Binary Analysis - Christien Rioux
Lessons Of Binary Analysis - Christien Rioux
crioux1
 
AC Atlassian Coimbatore Session Slides( 22/06/2024)
AC Atlassian Coimbatore Session Slides( 22/06/2024)AC Atlassian Coimbatore Session Slides( 22/06/2024)
AC Atlassian Coimbatore Session Slides( 22/06/2024)
apoorva2579
 
STKI Israeli Market Study 2024 final v1
STKI Israeli Market Study 2024 final  v1STKI Israeli Market Study 2024 final  v1
STKI Israeli Market Study 2024 final v1
Dr. Jimmy Schwarzkopf
 
Navigating Post-Quantum Blockchain: Resilient Cryptography in Quantum Threats
Navigating Post-Quantum Blockchain: Resilient Cryptography in Quantum ThreatsNavigating Post-Quantum Blockchain: Resilient Cryptography in Quantum Threats
Navigating Post-Quantum Blockchain: Resilient Cryptography in Quantum Threats
anupriti
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
Yevgen Sysoyev
 
UiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs ConferenceUiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs Conference
UiPathCommunity
 
HTTP Adaptive Streaming – Quo Vadis (2024)
HTTP Adaptive Streaming – Quo Vadis (2024)HTTP Adaptive Streaming – Quo Vadis (2024)
HTTP Adaptive Streaming – Quo Vadis (2024)
Alpen-Adria-Universität
 
The Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive ComputingThe Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive Computing
Larry Smarr
 

Recently uploaded (20)

Interaction Latency: Square's User-Centric Mobile Performance Metric
Interaction Latency: Square's User-Centric Mobile Performance MetricInteraction Latency: Square's User-Centric Mobile Performance Metric
Interaction Latency: Square's User-Centric Mobile Performance Metric
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
 
“Intel’s Approach to Operationalizing AI in the Manufacturing Sector,” a Pres...
“Intel’s Approach to Operationalizing AI in the Manufacturing Sector,” a Pres...“Intel’s Approach to Operationalizing AI in the Manufacturing Sector,” a Pres...
“Intel’s Approach to Operationalizing AI in the Manufacturing Sector,” a Pres...
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
 
Hire a private investigator to get cell phone records
Hire a private investigator to get cell phone recordsHire a private investigator to get cell phone records
Hire a private investigator to get cell phone records
 
Running a Go App in Kubernetes: CPU Impacts
Running a Go App in Kubernetes: CPU ImpactsRunning a Go App in Kubernetes: CPU Impacts
Running a Go App in Kubernetes: CPU Impacts
 
What's Next Web Development Trends to Watch.pdf
What's Next Web Development Trends to Watch.pdfWhat's Next Web Development Trends to Watch.pdf
What's Next Web Development Trends to Watch.pdf
 
What Not to Document and Why_ (North Bay Python 2024)
What Not to Document and Why_ (North Bay Python 2024)What Not to Document and Why_ (North Bay Python 2024)
What Not to Document and Why_ (North Bay Python 2024)
 
K2G - Insurtech Innovation EMEA Award 2024
K2G - Insurtech Innovation EMEA Award 2024K2G - Insurtech Innovation EMEA Award 2024
K2G - Insurtech Innovation EMEA Award 2024
 
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
 
Lessons Of Binary Analysis - Christien Rioux
Lessons Of Binary Analysis - Christien RiouxLessons Of Binary Analysis - Christien Rioux
Lessons Of Binary Analysis - Christien Rioux
 
AC Atlassian Coimbatore Session Slides( 22/06/2024)
AC Atlassian Coimbatore Session Slides( 22/06/2024)AC Atlassian Coimbatore Session Slides( 22/06/2024)
AC Atlassian Coimbatore Session Slides( 22/06/2024)
 
STKI Israeli Market Study 2024 final v1
STKI Israeli Market Study 2024 final  v1STKI Israeli Market Study 2024 final  v1
STKI Israeli Market Study 2024 final v1
 
Navigating Post-Quantum Blockchain: Resilient Cryptography in Quantum Threats
Navigating Post-Quantum Blockchain: Resilient Cryptography in Quantum ThreatsNavigating Post-Quantum Blockchain: Resilient Cryptography in Quantum Threats
Navigating Post-Quantum Blockchain: Resilient Cryptography in Quantum Threats
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
 
UiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs ConferenceUiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs Conference
 
HTTP Adaptive Streaming – Quo Vadis (2024)
HTTP Adaptive Streaming – Quo Vadis (2024)HTTP Adaptive Streaming – Quo Vadis (2024)
HTTP Adaptive Streaming – Quo Vadis (2024)
 
The Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive ComputingThe Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive Computing
 

Angular meetup 2 2019-08-29

  • 1. Angular (Session - 2) Nitin Bhojwani nbhojwani@vmware.com Saket Singh sakets@vmware.com Nikhil Gupta guptanikhil@vmware.com
  • 2. Agenda • Recap of the last talk “Angular Workshop – 1 (Getting started with Angular)” • Angular Component Lifecycle • Modularizing Angular application – How to do and benefits of it • Angular Routing – Routing in UI • Hands On • Essential Code guidelines from Angular Style Guide
  • 4. Recap - Angular • Angular helps you build modern applications for the web, mobile, or desktop. • Reusability • Components( a small patch of screen) are reusable – build once use everywhere. • Develop Across all platforms – Desktop, Mobile and others • Speed and Performance • Build features quickly with simple, declarative templates • https://angular.io/guide/architecture
  • 5. Recap - Why Angular? Single Page Application • SPA is fast as most of the resources(HTML, CSS, JS) are only loaded once throughout the lifespan of application. • Data is loaded independently using REST apis • Routing is handled in UI • Simplified and streamlined • More Control in UI – Less server involvement
  • 6. Recap - Why Angular? Accelerated DOM update • Accessing DOM tree is costly • Any runtime change in the page requires a DOM update. DOM update for every change will slaughter performance. • Optimize DOM updating process and accelerate it.
  • 7. Recap - Typescript • .ts file extension • JavaScript is Dynamically typed language • Problematic in bigger projects • TS provides static typing helps in development and preventing usual bugs • Superset of JavaScript • Even JavaScript code works on Typescript. • Object Oriented Programming
  • 8. Recap - Angular Building Blocks Component • A component controls a patch of screen called a view. • Presentation Logic goes here, can invoke based on user actions • Define: @Component({ selector: 'app-hero-list’, templateUrl: './hero-list.component.html’, providers: [ HeroService ] }) • Use: <app-hero-list></app-hero-list> • https://angular.io/guide/architecture-components
  • 9. Recap - Angular Building Blocks Service • Includes any value, function, or feature that an app needs. • A service is typically a class with a narrow, well-defined purpose. • Should do something specific and do it well. • Backend for view(Component) • Handles functionality
  • 10. Recap - Clarity Design System • Open sourced by VMware • UX guidelines, HTML/CSS framework, and Angular components • Don’t work on view from scratch • Reuse components provided by Clarity • https://clarity.design/
  • 12. Angular Component Lifecycle • A component has a lifecycle managed by Angular. • Creation • Rendering • Changes • Destruction • Makes it possible to execute code at different lifecycle events.
  • 13. Lifecycle Hooks ngOnChanges(): • Called before ngOnInit() and whenever one or more data-bound input properties change. • Code to react on input changes goes here. ngOnInit(): • Called once, after the first ngOnChanges() • Code to initialize component data, set initial values goes here. ngAfterContentInit(): • Called after Angular projects external content into the component's view. (Stuff that goes inside "ng-content" tags) • Pieces of HTML that can be passed from parent and projected in a child component.
  • 14. Lifecycle Hooks ngAfterViewInit(): • Triggered after the child components have been instantiated. • Allows for interaction between parent and child components. (ViewChild is assigned a valued here) ngOnDestroy(): • Triggered before a component is disposed. • Should handle closing streams and disposing off everything active.
  • 16. Modularizing Angular Applications Modules... What? Who? • Logical separation of a single monolithic codebase into distinct redistributable packages. • NgModules can contain components, service providers, and other code files. • It can import functionality that is exported from other NgModules, and export selected functionality for use by other NgModules. • It is independent of the rest of the project. • Angular has its own modularity system called NgModules.
  • 17. Modularizing Angular Applications Why Modules? • Clean code with proper separation of concern. Each module has a set functional responsibility. • Easier to work with since it inherently avoids spaghetti. • Well defined inter module interaction. Module interfaces generally remain unchanged. • Reusable across multiple projects. • Allows for lazy loading of code within the app. • Each module compiles to a different JS file. • Few parts of code might not be required at all. No reason to fetch it all at once. • Greatly reduces the time it takes to initially load the app.
  • 20. (Hands On) Refactoring from last hands-on • https://github.com/tech-talky/wwc-weather • After the last hands-on, some refactoring is done: • weather-status – new feature module • migrate app.component.html and app.component.ts content to another component in the new module weather-status • Basic routing
  • 21. (Hands On) Bring Code Locally • Clone the repo and start locally • git clone https://github.com/tech-talky/wwc-weather • cd wwc-weather • npm install • ng serve –port 5000 • Let’s go through the code
  • 22. (Hands On) What to do next? • Start with routing and modularizing • Create another feature module with children routing and main components: • forecasting – get new component added • Configure routing: • https://angular.io/guide/lazy-loading-ngmodules#routes-at-the-app-level
  • 23. (Hands On) What to do next? • Vertical Nav from Clarity • https://clarity.design/documentation/vertical-nav/collapsible-nav/normal • forecast.component.ts – main component of forecast module • Add map component to forecast component • https://angular-maps.com/guides/getting-started/ • Input to component – lat, long • Output from component – any new marker on the map • https://stackblitz.com/edit/angular-google-maps-demo • Next – Based upon the output from above component get forecasting
  • 24. Essential Coding Practices - Separation of Concerns: • Split into modules - Lazy load your modules depending on need. • Rule of one – easy reading and maintenance, avoid dependency collisions - Use services for reusable business logic • Write small, pure functions - Make reusable components - Follow the style guide by Angular (https://angular.io/guide/styleguide)