Overview
PageComponent is a wrapper component for individual pages in the Jet application. It automatically manages SEO meta tags (title, description, keywords, Open Graph tags) and updates the toolbar title based on input properties.
Selector
Usage
Wrap your page content withPageComponent and provide required SEO inputs:
Inputs
Page title for browser tab and Open Graph. Sets both
<title> tag and og:title meta tag.Example: "Home - Jet Application"Page description for search engines and social media. Sets both
description and og:description meta tags.Example: "Welcome to the Jet Angular starter kit home page"Comma-separated keywords for SEO. Sets the
keywords meta tag.Example: "angular, starter kit, pwa, material design"Title displayed in the application toolbar. Updates the
ToolbarTitleService signal.Example: "Dashboard"Optional custom Open Graph image URL. If not provided, defaults to
/og-image.jpg from the application origin.Example: "https://example.com/custom-og-image.jpg"Features
Automatic SEO Management
The component uses Angular effects to automatically update meta tags whenever input values change:- Browser Title: Updated via Angular’s
Titleservice - Meta Description: Standard and Open Graph description tags
- Meta Keywords: Search engine keywords
- Open Graph Image: Social media preview image
- Open Graph Title: Social media title
Content Projection
The component uses<ng-content /> to project child content, making it a transparent wrapper around your page content.
Effects
The component implements five Angular effects that watch input signals:seoDescription Effect
Updates the description meta tags:seoImageUrl Effect
Updates the Open Graph image, falling back to default if not provided:seoKeywords Effect
Updates the keywords meta tag:seoTitle Effect
Updates both browser title and Open Graph title:toolbarTitle Effect
Updates the toolbar title displayed in the app header:Dependencies
The component injects these services:Meta- Angular meta tag managementTitle- Angular page title serviceLoggerService- Debug logging for effect runsToolbarTitleService- Toolbar title state management
Example: Complete Page Implementation
Best Practices
- Always provide required inputs: seoTitle, seoDescription, seoKeywords, and toolbarTitle are required
- Keep titles concise: Aim for 50-60 characters for SEO titles
- Write descriptive descriptions: 150-160 characters is optimal for search results
- Use relevant keywords: Comma-separated, 5-10 keywords is ideal
- Custom OG images: Provide custom
seoImageUrlfor important pages (1200x630px recommended) - Toolbar titles: Keep short and descriptive for the app header
Source
Location:src/app/components/page/page.component.ts