Skip to content

Instantly share code, notes, and snippets.

@nhathiwala
Last active November 6, 2023 07:23
Show Gist options
  • Save nhathiwala/affd3b0062da5fd4acf9f830a0b62887 to your computer and use it in GitHub Desktop.
Save nhathiwala/affd3b0062da5fd4acf9f830a0b62887 to your computer and use it in GitHub Desktop.
SEO Service for Angular 4+ | Example for SeoService: https://gist.github.com/nhathiwala/7aec328fdf129393389f826c7f5f2943
import { Component, OnInit } from '@angular/core';
import { SeoService } from '../../services/seo.service';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.scss']
})
export class HomeComponent implements OnInit {
constructor(private seo: SeoService) {
this.seo.setTags({
title: 'Home', // Title
titleSuffix: '- Knoxpo', // Title Suffix
description: 'Your description', // Description
image: 'https://storage.googleapis.com/knoxpo/cover.png', // Image
keywords: 'mobile, android, ios, swift, cloud development' // Keywords
});
}
ngOnInit() { }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment