SlideShare a Scribd company logo
1 of 20
Download to read offline
Server-Side
Rendering
(SSR) with
Angular
Universal
www.bacancytechnology.com
By default, Angular applications execute on the
client browser by rendering the pages whenever
a user takes any action. Sometimes, we need to
render the pages ahead of time, i.e., on the server-
side or at the build time. And that’s why we will
use Angular Universal.
Angular Universal executes on the server-side by
generating static pages and later are sent to the
client browser for display. Thus, Angular
Universal renders the app more quickly and
allows users to view the application’s layout.
Without further ado, let’s learn more about SSR
with Angular Universal. The tutorial is divided
into various sections to make it easier to
understand.
Table of Content
1. What is Server-Side Rendering (SSR)?
2. Advantages of Server-Side Rendering
3. What is Angular Universal?
4. Steps to implement Server-Side
Rendering (SSR) with Angular Universal
5. Conclusion
What is
Server-Side
Rendering?
Server-Side Rendering was implemented
many years ago, but we have lessened the
use of SSR after being introduced to client-
side rendering. So, let’s see what SSR is?
Server-Side Rendering (SSR) means the
server will return the static HTML page,
including all the data, to the client, after
compiling everything. The server has to
perform the complete process again
whenever the route changes. The server-
Side script is used to fetch the dynamic
data; these scripts are written in the server-
side language.
Let’s discuss some of the advantages of SSR.
Advantages
of SSR
It provides a side better user experience
by decreasing the initial page load time.
As the application will load faster, the
search engine bots will crawl and index
the pages better than before. Thus, gives
a better SEO experience.
Provides an optimum solution for users
having a slow internet connection.
A pleasant preview will be seen on
copying a page link and sending it to
others or posting it on social media,
consisting of the page title, image, and
description. It helps in Social Media
Optimization (SMO)
What is
Angular
Universal?
Angular Universal is the process that
manages to render the static HTML page on
the server and further return to the client-
side. In a nutshell, Angular Universal is
Angular Server Side Rendering. You can
refer to the Angular Universal
documentation for exploring how Angular
Universal works and how it affects its
performance?
In case you missed the official
announcement from Angular team of
Angular Universal 9.0
Steps to
implement
Server-Side
Rendering
(SSR) with
Angular
Universal
Check the version of your angular CLI
using this command
If your CLI version is less than v9, then
upgrade to the latest version using this
command
Step – 1 Angular Version Checking
ng --version
Create Angular Application using this
command
npm i -g @angular/cli
Step – 2 Create Angular Application
ng new Angular-SSR-Demo
Navigate and open the project
Open the terminal and enter the
command to run your application on
your local machine.
Angular CLI will create a folder and install
the required packages & dependencies.
cd Angular-SSR-Demo
Step – 3 Run Angular Application
ng serve
Right-click on the browser and click on
the view page source; the page source
will be similar to the given image below.
Your application will be running on
http://localhost:4200.
Here you can only see < app-root > < / app-
root >, and no static HTML page is
displayed; it is because most of the data is
loaded at the client-side. By default, the
application created with CLI is configured
to have client-side rendering. While with
the help of Angular Universal, we can
configure server-side rendering (SSR)
smoothly.
For adding SSR to your application,
enter the following command
Step – 4 Adding Angular SSR to our
Application
ng add @nguniversal/express-engine
The command will create few files & will
also update some existing files.
After the command is executed, you’ll see
something like this in your terminal-
You can see that 4 new files are created
& 5 files are updated. Let’s have a look
over the changes in the package.json file
to view newly added scripts &
packages.
⦿Scripts
⦿Packages added packages
To see the result of the SSR on a local
machine, we will now need to run our
application using this command
Step – 5 Result of SSR
Right-click on the browser and click on
the view page source; now, the page
source will show the static HTML tags &
styles for our UI. It will be something
like the below-given image.
npm run dev:ssr
The UI will remain the same, as we haven’t
changed the HTML.
Conclusion
So, this was all about Server-side rendering
with Angular Universal. I hope your
purpose of landing on this Angular
universal tutorial is served. Visit Angular
Tutorials, from where you can learn
fundamental and advanced Angular
knowledge from our Angular experts.
Angular developers at Bacancy Technology
are passionate and can fulfil your complex
product requirements by setting-up server-
side rendering and pre-rendering with
Angular Universal and Express. Hire
Angular developer from us to get started
with Angular Universal.
Thank You
www.bacancytechnology.com

More Related Content

What's hot

An overview of selenium webdriver
An overview of selenium webdriverAn overview of selenium webdriver
An overview of selenium webdriverAnuraj S.L
 
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 projectJadson Santos
 
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...Edureka!
 
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!
 
NextJS, A JavaScript Framework for building next generation SPA
NextJS, A JavaScript Framework for building next generation SPA  NextJS, A JavaScript Framework for building next generation SPA
NextJS, A JavaScript Framework for building next generation SPA Pramendra Gupta
 
Angular interview questions
Angular interview questionsAngular interview questions
Angular interview questionsGoa App
 
Sharing Data Between Angular Components
Sharing Data Between Angular ComponentsSharing Data Between Angular Components
Sharing Data Between Angular ComponentsSquash Apps Pvt Ltd
 
Angular Interview Questions-PDF.pdf
Angular Interview Questions-PDF.pdfAngular Interview Questions-PDF.pdf
Angular Interview Questions-PDF.pdfJohnLeo57
 
Advanced Javascript
Advanced JavascriptAdvanced Javascript
Advanced JavascriptAdieu
 
Single Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJSSingle Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJSM R Rony
 
Design Pattern - MVC, MVP and MVVM
Design Pattern - MVC, MVP and MVVMDesign Pattern - MVC, MVP and MVVM
Design Pattern - MVC, MVP and MVVMMudasir Qazi
 
Angular - Chapter 5 - Directives
 Angular - Chapter 5 - Directives Angular - Chapter 5 - Directives
Angular - Chapter 5 - DirectivesWebStackAcademy
 
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 HandlingWebStackAcademy
 

What's hot (20)

Server side rendering review
Server side rendering reviewServer side rendering review
Server side rendering review
 
Angular modules in depth
Angular modules in depthAngular modules in depth
Angular modules in depth
 
An overview of selenium webdriver
An overview of selenium webdriverAn overview of selenium webdriver
An overview of selenium webdriver
 
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
 
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
 
Angular introduction students
Angular introduction studentsAngular introduction students
Angular introduction students
 
Selenium WebDriver FAQ's
Selenium WebDriver FAQ'sSelenium WebDriver FAQ's
Selenium WebDriver FAQ's
 
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...
 
NextJS, A JavaScript Framework for building next generation SPA
NextJS, A JavaScript Framework for building next generation SPA  NextJS, A JavaScript Framework for building next generation SPA
NextJS, A JavaScript Framework for building next generation SPA
 
Angular interview questions
Angular interview questionsAngular interview questions
Angular interview questions
 
Selenium WebDriver
Selenium WebDriverSelenium WebDriver
Selenium WebDriver
 
Sharing Data Between Angular Components
Sharing Data Between Angular ComponentsSharing Data Between Angular Components
Sharing Data Between Angular Components
 
Angular Interview Questions-PDF.pdf
Angular Interview Questions-PDF.pdfAngular Interview Questions-PDF.pdf
Angular Interview Questions-PDF.pdf
 
Advanced Javascript
Advanced JavascriptAdvanced Javascript
Advanced Javascript
 
Angular overview
Angular overviewAngular overview
Angular overview
 
Single Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJSSingle Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJS
 
Design Pattern - MVC, MVP and MVVM
Design Pattern - MVC, MVP and MVVMDesign Pattern - MVC, MVP and MVVM
Design Pattern - MVC, MVP and MVVM
 
Angular - Chapter 5 - Directives
 Angular - Chapter 5 - Directives Angular - Chapter 5 - Directives
Angular - Chapter 5 - Directives
 
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
AngularAngular
Angular
 

Similar to Server-Side Rendering (SSR) with Angular Universal

Angular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaAngular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaphp2ranjan
 
Why Use Server Side Rendering To Boost Performance and User Experience?
Why Use Server Side Rendering To Boost Performance and User Experience?Why Use Server Side Rendering To Boost Performance and User Experience?
Why Use Server Side Rendering To Boost Performance and User Experience?TOPS Infosolutions
 
Angularjs Development Company USA
Angularjs Development Company USA Angularjs Development Company USA
Angularjs Development Company USA Shelly Megan
 
Web worker in your angular application
Web worker in your angular applicationWeb worker in your angular application
Web worker in your angular applicationSuresh Patidar
 
Difference Between Angular and AngularJS.pdf
Difference Between Angular and AngularJS.pdfDifference Between Angular and AngularJS.pdf
Difference Between Angular and AngularJS.pdfYour Team in India
 
Angular kickstart slideshare
Angular kickstart   slideshareAngular kickstart   slideshare
Angular kickstart slideshareSaleemMalik52
 
Top Features Of Angular 13 You Must Know
Top Features Of Angular 13 You Must KnowTop Features Of Angular 13 You Must Know
Top Features Of Angular 13 You Must Knowsimonedaniels3
 
What’s new in angular 13 and why should you use it for web app development pr...
What’s new in angular 13 and why should you use it for web app development pr...What’s new in angular 13 and why should you use it for web app development pr...
What’s new in angular 13 and why should you use it for web app development pr...Moon Technolabs Pvt. Ltd.
 
Angularjs 131211063348-phpapp01
Angularjs 131211063348-phpapp01Angularjs 131211063348-phpapp01
Angularjs 131211063348-phpapp01Arunangsu Sahu
 
Top 10 Angular Development Tools For Developers
Top 10 Angular Development Tools For DevelopersTop 10 Angular Development Tools For Developers
Top 10 Angular Development Tools For DevelopersAlbiorix Technology
 
Progressive Web Application by Citytech
Progressive Web Application by CitytechProgressive Web Application by Citytech
Progressive Web Application by CitytechRitwik Das
 
Angular Project Report
 Angular Project Report Angular Project Report
Angular Project ReportKodexhub
 
The Growing Popularity of AngularJS
The Growing Popularity of AngularJSThe Growing Popularity of AngularJS
The Growing Popularity of AngularJSWhiz Solutions
 
10 Reasons to Choose Angular for Web App Development.pdf
10 Reasons to Choose Angular for Web App Development.pdf10 Reasons to Choose Angular for Web App Development.pdf
10 Reasons to Choose Angular for Web App Development.pdfWebGuru Infosystems Pvt. Ltd.
 

Similar to Server-Side Rendering (SSR) with Angular Universal (20)

What’s New in Angular 15.pptx
What’s New in Angular 15.pptxWhat’s New in Angular 15.pptx
What’s New in Angular 15.pptx
 
Angular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaAngular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad india
 
What is Angular Ivy?
What is Angular Ivy?What is Angular Ivy?
What is Angular Ivy?
 
Why Use Server Side Rendering To Boost Performance and User Experience?
Why Use Server Side Rendering To Boost Performance and User Experience?Why Use Server Side Rendering To Boost Performance and User Experience?
Why Use Server Side Rendering To Boost Performance and User Experience?
 
Angularjs Development Company USA
Angularjs Development Company USA Angularjs Development Company USA
Angularjs Development Company USA
 
Web worker in your angular application
Web worker in your angular applicationWeb worker in your angular application
Web worker in your angular application
 
Difference Between Angular and AngularJS.pdf
Difference Between Angular and AngularJS.pdfDifference Between Angular and AngularJS.pdf
Difference Between Angular and AngularJS.pdf
 
THE FUTURE OF ANGULAR JS
THE FUTURE OF ANGULAR JSTHE FUTURE OF ANGULAR JS
THE FUTURE OF ANGULAR JS
 
What is the Use of Angular?
What is the Use of Angular?What is the Use of Angular?
What is the Use of Angular?
 
What are The Top Features of Angular 7?
What are The Top Features of Angular 7?What are The Top Features of Angular 7?
What are The Top Features of Angular 7?
 
Angular kickstart slideshare
Angular kickstart   slideshareAngular kickstart   slideshare
Angular kickstart slideshare
 
Top Features Of Angular 13 You Must Know
Top Features Of Angular 13 You Must KnowTop Features Of Angular 13 You Must Know
Top Features Of Angular 13 You Must Know
 
What’s new in angular 13 and why should you use it for web app development pr...
What’s new in angular 13 and why should you use it for web app development pr...What’s new in angular 13 and why should you use it for web app development pr...
What’s new in angular 13 and why should you use it for web app development pr...
 
AngularJs
AngularJsAngularJs
AngularJs
 
Angularjs 131211063348-phpapp01
Angularjs 131211063348-phpapp01Angularjs 131211063348-phpapp01
Angularjs 131211063348-phpapp01
 
Top 10 Angular Development Tools For Developers
Top 10 Angular Development Tools For DevelopersTop 10 Angular Development Tools For Developers
Top 10 Angular Development Tools For Developers
 
Progressive Web Application by Citytech
Progressive Web Application by CitytechProgressive Web Application by Citytech
Progressive Web Application by Citytech
 
Angular Project Report
 Angular Project Report Angular Project Report
Angular Project Report
 
The Growing Popularity of AngularJS
The Growing Popularity of AngularJSThe Growing Popularity of AngularJS
The Growing Popularity of AngularJS
 
10 Reasons to Choose Angular for Web App Development.pdf
10 Reasons to Choose Angular for Web App Development.pdf10 Reasons to Choose Angular for Web App Development.pdf
10 Reasons to Choose Angular for Web App Development.pdf
 

More from Katy Slemon

React Alternatives Frameworks- Lightweight Javascript Libraries.pdf
React Alternatives Frameworks- Lightweight Javascript Libraries.pdfReact Alternatives Frameworks- Lightweight Javascript Libraries.pdf
React Alternatives Frameworks- Lightweight Javascript Libraries.pdfKaty Slemon
 
Data Science Use Cases in Retail & Healthcare Industries.pdf
Data Science Use Cases in Retail & Healthcare Industries.pdfData Science Use Cases in Retail & Healthcare Industries.pdf
Data Science Use Cases in Retail & Healthcare Industries.pdfKaty Slemon
 
How Much Does It Cost To Hire Golang Developer.pdf
How Much Does It Cost To Hire Golang Developer.pdfHow Much Does It Cost To Hire Golang Developer.pdf
How Much Does It Cost To Hire Golang Developer.pdfKaty Slemon
 
What’s New in Flutter 3.pdf
What’s New in Flutter 3.pdfWhat’s New in Flutter 3.pdf
What’s New in Flutter 3.pdfKaty Slemon
 
Why Use Ruby On Rails.pdf
Why Use Ruby On Rails.pdfWhy Use Ruby On Rails.pdf
Why Use Ruby On Rails.pdfKaty Slemon
 
How Much Does It Cost To Hire Full Stack Developer In 2022.pdf
How Much Does It Cost To Hire Full Stack Developer In 2022.pdfHow Much Does It Cost To Hire Full Stack Developer In 2022.pdf
How Much Does It Cost To Hire Full Stack Developer In 2022.pdfKaty Slemon
 
How to Implement Middleware Pipeline in VueJS.pdf
How to Implement Middleware Pipeline in VueJS.pdfHow to Implement Middleware Pipeline in VueJS.pdf
How to Implement Middleware Pipeline in VueJS.pdfKaty Slemon
 
How to Build Laravel Package Using Composer.pdf
How to Build Laravel Package Using Composer.pdfHow to Build Laravel Package Using Composer.pdf
How to Build Laravel Package Using Composer.pdfKaty Slemon
 
Sure Shot Ways To Improve And Scale Your Node js Performance.pdf
Sure Shot Ways To Improve And Scale Your Node js Performance.pdfSure Shot Ways To Improve And Scale Your Node js Performance.pdf
Sure Shot Ways To Improve And Scale Your Node js Performance.pdfKaty Slemon
 
How to Develop Slack Bot Using Golang.pdf
How to Develop Slack Bot Using Golang.pdfHow to Develop Slack Bot Using Golang.pdf
How to Develop Slack Bot Using Golang.pdfKaty Slemon
 
IoT Based Battery Management System in Electric Vehicles.pdf
IoT Based Battery Management System in Electric Vehicles.pdfIoT Based Battery Management System in Electric Vehicles.pdf
IoT Based Battery Management System in Electric Vehicles.pdfKaty Slemon
 
Understanding Flexbox Layout in React Native.pdf
Understanding Flexbox Layout in React Native.pdfUnderstanding Flexbox Layout in React Native.pdf
Understanding Flexbox Layout in React Native.pdfKaty Slemon
 
The Ultimate Guide to Laravel Performance Optimization in 2022.pdf
The Ultimate Guide to Laravel Performance Optimization in 2022.pdfThe Ultimate Guide to Laravel Performance Optimization in 2022.pdf
The Ultimate Guide to Laravel Performance Optimization in 2022.pdfKaty Slemon
 
New Features in iOS 15 and Swift 5.5.pdf
New Features in iOS 15 and Swift 5.5.pdfNew Features in iOS 15 and Swift 5.5.pdf
New Features in iOS 15 and Swift 5.5.pdfKaty Slemon
 
How to Hire & Manage Dedicated Team For Your Next Product Development.pdf
How to Hire & Manage Dedicated Team For Your Next Product Development.pdfHow to Hire & Manage Dedicated Team For Your Next Product Development.pdf
How to Hire & Manage Dedicated Team For Your Next Product Development.pdfKaty Slemon
 
Choose the Right Battery Management System for Lithium Ion Batteries.pdf
Choose the Right Battery Management System for Lithium Ion Batteries.pdfChoose the Right Battery Management System for Lithium Ion Batteries.pdf
Choose the Right Battery Management System for Lithium Ion Batteries.pdfKaty Slemon
 
Flutter Performance Tuning Best Practices From the Pros.pdf
Flutter Performance Tuning Best Practices From the Pros.pdfFlutter Performance Tuning Best Practices From the Pros.pdf
Flutter Performance Tuning Best Practices From the Pros.pdfKaty Slemon
 
Angular Universal How to Build Angular SEO Friendly App.pdf
Angular Universal How to Build Angular SEO Friendly App.pdfAngular Universal How to Build Angular SEO Friendly App.pdf
Angular Universal How to Build Angular SEO Friendly App.pdfKaty Slemon
 
How to Set Up and Send Mails Using SendGrid in NodeJs App.pdf
How to Set Up and Send Mails Using SendGrid in NodeJs App.pdfHow to Set Up and Send Mails Using SendGrid in NodeJs App.pdf
How to Set Up and Send Mails Using SendGrid in NodeJs App.pdfKaty Slemon
 
Ruby On Rails Performance Tuning Guide.pdf
Ruby On Rails Performance Tuning Guide.pdfRuby On Rails Performance Tuning Guide.pdf
Ruby On Rails Performance Tuning Guide.pdfKaty Slemon
 

More from Katy Slemon (20)

React Alternatives Frameworks- Lightweight Javascript Libraries.pdf
React Alternatives Frameworks- Lightweight Javascript Libraries.pdfReact Alternatives Frameworks- Lightweight Javascript Libraries.pdf
React Alternatives Frameworks- Lightweight Javascript Libraries.pdf
 
Data Science Use Cases in Retail & Healthcare Industries.pdf
Data Science Use Cases in Retail & Healthcare Industries.pdfData Science Use Cases in Retail & Healthcare Industries.pdf
Data Science Use Cases in Retail & Healthcare Industries.pdf
 
How Much Does It Cost To Hire Golang Developer.pdf
How Much Does It Cost To Hire Golang Developer.pdfHow Much Does It Cost To Hire Golang Developer.pdf
How Much Does It Cost To Hire Golang Developer.pdf
 
What’s New in Flutter 3.pdf
What’s New in Flutter 3.pdfWhat’s New in Flutter 3.pdf
What’s New in Flutter 3.pdf
 
Why Use Ruby On Rails.pdf
Why Use Ruby On Rails.pdfWhy Use Ruby On Rails.pdf
Why Use Ruby On Rails.pdf
 
How Much Does It Cost To Hire Full Stack Developer In 2022.pdf
How Much Does It Cost To Hire Full Stack Developer In 2022.pdfHow Much Does It Cost To Hire Full Stack Developer In 2022.pdf
How Much Does It Cost To Hire Full Stack Developer In 2022.pdf
 
How to Implement Middleware Pipeline in VueJS.pdf
How to Implement Middleware Pipeline in VueJS.pdfHow to Implement Middleware Pipeline in VueJS.pdf
How to Implement Middleware Pipeline in VueJS.pdf
 
How to Build Laravel Package Using Composer.pdf
How to Build Laravel Package Using Composer.pdfHow to Build Laravel Package Using Composer.pdf
How to Build Laravel Package Using Composer.pdf
 
Sure Shot Ways To Improve And Scale Your Node js Performance.pdf
Sure Shot Ways To Improve And Scale Your Node js Performance.pdfSure Shot Ways To Improve And Scale Your Node js Performance.pdf
Sure Shot Ways To Improve And Scale Your Node js Performance.pdf
 
How to Develop Slack Bot Using Golang.pdf
How to Develop Slack Bot Using Golang.pdfHow to Develop Slack Bot Using Golang.pdf
How to Develop Slack Bot Using Golang.pdf
 
IoT Based Battery Management System in Electric Vehicles.pdf
IoT Based Battery Management System in Electric Vehicles.pdfIoT Based Battery Management System in Electric Vehicles.pdf
IoT Based Battery Management System in Electric Vehicles.pdf
 
Understanding Flexbox Layout in React Native.pdf
Understanding Flexbox Layout in React Native.pdfUnderstanding Flexbox Layout in React Native.pdf
Understanding Flexbox Layout in React Native.pdf
 
The Ultimate Guide to Laravel Performance Optimization in 2022.pdf
The Ultimate Guide to Laravel Performance Optimization in 2022.pdfThe Ultimate Guide to Laravel Performance Optimization in 2022.pdf
The Ultimate Guide to Laravel Performance Optimization in 2022.pdf
 
New Features in iOS 15 and Swift 5.5.pdf
New Features in iOS 15 and Swift 5.5.pdfNew Features in iOS 15 and Swift 5.5.pdf
New Features in iOS 15 and Swift 5.5.pdf
 
How to Hire & Manage Dedicated Team For Your Next Product Development.pdf
How to Hire & Manage Dedicated Team For Your Next Product Development.pdfHow to Hire & Manage Dedicated Team For Your Next Product Development.pdf
How to Hire & Manage Dedicated Team For Your Next Product Development.pdf
 
Choose the Right Battery Management System for Lithium Ion Batteries.pdf
Choose the Right Battery Management System for Lithium Ion Batteries.pdfChoose the Right Battery Management System for Lithium Ion Batteries.pdf
Choose the Right Battery Management System for Lithium Ion Batteries.pdf
 
Flutter Performance Tuning Best Practices From the Pros.pdf
Flutter Performance Tuning Best Practices From the Pros.pdfFlutter Performance Tuning Best Practices From the Pros.pdf
Flutter Performance Tuning Best Practices From the Pros.pdf
 
Angular Universal How to Build Angular SEO Friendly App.pdf
Angular Universal How to Build Angular SEO Friendly App.pdfAngular Universal How to Build Angular SEO Friendly App.pdf
Angular Universal How to Build Angular SEO Friendly App.pdf
 
How to Set Up and Send Mails Using SendGrid in NodeJs App.pdf
How to Set Up and Send Mails Using SendGrid in NodeJs App.pdfHow to Set Up and Send Mails Using SendGrid in NodeJs App.pdf
How to Set Up and Send Mails Using SendGrid in NodeJs App.pdf
 
Ruby On Rails Performance Tuning Guide.pdf
Ruby On Rails Performance Tuning Guide.pdfRuby On Rails Performance Tuning Guide.pdf
Ruby On Rails Performance Tuning Guide.pdf
 

Recently uploaded

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 

Recently uploaded (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

Server-Side Rendering (SSR) with Angular Universal

  • 2. By default, Angular applications execute on the client browser by rendering the pages whenever a user takes any action. Sometimes, we need to render the pages ahead of time, i.e., on the server- side or at the build time. And that’s why we will use Angular Universal. Angular Universal executes on the server-side by generating static pages and later are sent to the client browser for display. Thus, Angular Universal renders the app more quickly and allows users to view the application’s layout. Without further ado, let’s learn more about SSR with Angular Universal. The tutorial is divided into various sections to make it easier to understand.
  • 3. Table of Content 1. What is Server-Side Rendering (SSR)? 2. Advantages of Server-Side Rendering 3. What is Angular Universal? 4. Steps to implement Server-Side Rendering (SSR) with Angular Universal 5. Conclusion
  • 5. Server-Side Rendering was implemented many years ago, but we have lessened the use of SSR after being introduced to client- side rendering. So, let’s see what SSR is? Server-Side Rendering (SSR) means the server will return the static HTML page, including all the data, to the client, after compiling everything. The server has to perform the complete process again whenever the route changes. The server- Side script is used to fetch the dynamic data; these scripts are written in the server- side language.
  • 6. Let’s discuss some of the advantages of SSR.
  • 8. It provides a side better user experience by decreasing the initial page load time. As the application will load faster, the search engine bots will crawl and index the pages better than before. Thus, gives a better SEO experience. Provides an optimum solution for users having a slow internet connection. A pleasant preview will be seen on copying a page link and sending it to others or posting it on social media, consisting of the page title, image, and description. It helps in Social Media Optimization (SMO)
  • 10. Angular Universal is the process that manages to render the static HTML page on the server and further return to the client- side. In a nutshell, Angular Universal is Angular Server Side Rendering. You can refer to the Angular Universal documentation for exploring how Angular Universal works and how it affects its performance? In case you missed the official announcement from Angular team of Angular Universal 9.0
  • 11.
  • 13. Check the version of your angular CLI using this command If your CLI version is less than v9, then upgrade to the latest version using this command Step – 1 Angular Version Checking ng --version Create Angular Application using this command npm i -g @angular/cli Step – 2 Create Angular Application ng new Angular-SSR-Demo
  • 14. Navigate and open the project Open the terminal and enter the command to run your application on your local machine. Angular CLI will create a folder and install the required packages & dependencies. cd Angular-SSR-Demo Step – 3 Run Angular Application ng serve
  • 15. Right-click on the browser and click on the view page source; the page source will be similar to the given image below. Your application will be running on http://localhost:4200. Here you can only see < app-root > < / app- root >, and no static HTML page is displayed; it is because most of the data is loaded at the client-side. By default, the application created with CLI is configured to have client-side rendering. While with the help of Angular Universal, we can configure server-side rendering (SSR) smoothly.
  • 16. For adding SSR to your application, enter the following command Step – 4 Adding Angular SSR to our Application ng add @nguniversal/express-engine The command will create few files & will also update some existing files. After the command is executed, you’ll see something like this in your terminal-
  • 17. You can see that 4 new files are created & 5 files are updated. Let’s have a look over the changes in the package.json file to view newly added scripts & packages. ⦿Scripts ⦿Packages added packages To see the result of the SSR on a local machine, we will now need to run our application using this command Step – 5 Result of SSR
  • 18. Right-click on the browser and click on the view page source; now, the page source will show the static HTML tags & styles for our UI. It will be something like the below-given image. npm run dev:ssr The UI will remain the same, as we haven’t changed the HTML.
  • 19. Conclusion So, this was all about Server-side rendering with Angular Universal. I hope your purpose of landing on this Angular universal tutorial is served. Visit Angular Tutorials, from where you can learn fundamental and advanced Angular knowledge from our Angular experts. Angular developers at Bacancy Technology are passionate and can fulfil your complex product requirements by setting-up server- side rendering and pre-rendering with Angular Universal and Express. Hire Angular developer from us to get started with Angular Universal.