Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Beginning Server-Side Application Development with Angular

You're reading from   Beginning Server-Side Application Development with Angular Discover how to rapidly prototype SEO-friendly web applications with Angular Universal

Arrow left icon
Product type Paperback
Published in Apr 2018
Publisher
ISBN-13 9781789342161
Length 110 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Bram Borggreve Bram Borggreve
Author Profile Icon Bram Borggreve
Bram Borggreve
Arrow right icon
View More author details
Toc

Adding Dynamic Metadata


Now that our pages can be rendered using server-side rendering, we can introduce new functionality to enhance the appearance of our app.

At the moment, our app will still only display the default title set in src/index.html and we won't have any other HTML meta tags added.

To enhance the SEO friendliness of our page, and to make sure there is valuable information in our social preview, we want to address this.

Luckily, Angular comes with the Meta and Title classes, which allow us to add dynamic titles and metadata to our pages.

When combined with server-side rendering, the metadata and page title will make sure that the pages that are indexed by the search engine have the proper meta tags set in the document header, and thus increase findability.

In this section, we will add a service that allows us to define this data, and we will update our container components to call in that service after the data is loaded from our resolvers.

Creating the UiService

  1. Open a terminal inside...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image