Skip to content

Instantly share code, notes, and snippets.

@baunov
Created June 14, 2020 13:01
Show Gist options
  • Save baunov/7691f4f77ce5f8c5916bc3a9e9ff0fd0 to your computer and use it in GitHub Desktop.
Save baunov/7691f4f77ce5f8c5916bc3a9e9ff0fd0 to your computer and use it in GitHub Desktop.
import {Component, OnInit, Optional} from '@angular/core';
import { MetadataService } from '../../metadata.service';
@Component({
selector: 'app-page1',
templateUrl: './page1.component.html',
styleUrls: ['./page1.component.scss']
})
export class Page1Component implements OnInit {
constructor(@Optional() private metadataService: MetadataService) {}
ngOnInit(): void {
if (this.metadataService) {
this.metadataService.updateMetadata({
title: 'Page 1',
description: 'There is some content on page 1'
});
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment