Skip to content

Meta, Title packages from '@angular/platform-browser', not showing title and description in view-source #8743

@jvkiran

Description

@jvkiran

import { Injectable } from '@angular/core';
import { Meta } from '@angular/platform-browser';
import { Title } from '@angular/platform-browser';

@Injectable()
export class SeoService {

private titleService: Title;
private metaDescriprtion: Meta

constructor(
    private _meta: Meta,
    private _titleService: Title
) {}

public setTitle(newTitle: string) {
    this._titleService.setTitle(newTitle);
}

public setMetaDescription(description: string) {
    this._meta.addTag({name: "description", content: description})
}

}

Above code does't show title and description in view-source.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions