Created
June 14, 2020 13:01
-
-
Save baunov/7691f4f77ce5f8c5916bc3a9e9ff0fd0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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