File

projects/commons/src/lib/elements/meta/services/meta.service.ts

Index

Methods

Constructor

constructor(meta: Meta, title: Title)
Parameters :
Name Type Optional
meta Meta No
title Title No

Methods

Public update
update(url, undefined)
Parameters :
Name Optional
url No
No
Returns : void
import { Injectable } from '@angular/core';
import { Meta, Title } from '@angular/platform-browser';

@Injectable()
export class MetaService {
    constructor(
        private readonly meta: Meta,
        private readonly title: Title,
    ) {}

    public update(url, { title, description }) {
        this.title.setTitle(title);
        this.meta.updateTag({ property: 'og:title', content: title });
        this.meta.updateTag({ property: 'og:description', content: description });
    }
}

result-matching ""

    No results matching ""