My question is similar to this except I'm not getting any error. The titles that I've added are visible on the tab and the meta tags can be seen when I'm inspecting the page. But on the view page source, both the title and the meta tags are not visible. How do I make them visible on the View Page Source as well?
I've pre-rendered my website.
Code that I am using:
import { Component, OnInit } from '@angular/core';
import { Meta, Title } from '@angular/platform-browser';
import { Router } from '@angular/router';
@Component({
selector: 'app-some',
templateUrl: './some.component.html',
styleUrls: ['./some.component.css'],
})
export class HighlightsComponent implements OnInit {
constructor(
private router: Router,
private titleService: Title,
private metaService: Meta
) {}
title = 'Some Title';
ngOnInit(): void {
this.titleService.setTitle(this.title);
this.metaService.addTags([
{ name: 'robots', content: 'index, follow' },
]);
}
}