import { Component, Input, OnInit } from '@angular/core'; import { Meta, Title, MetaDefinition } from '@angular/platform-browser'; import { LinkDefinition } from '../../models/link-definition.interface'; import { MetaLink } from '../../services/meta-link/meta-link.service'; @Component({ selector: 'hdca-page', templateUrl: './hdca-page.component.html' }) export class HDCAPageComponent implements OnInit { @Input() JsonLDs: any[]; @Input() tags: MetaDefinition[]; @Input() title: string; @Input() metaLinks?: LinkDefinition[]; constructor( public meta: Meta, public meta_title: Title, public metaLinkService: MetaLink ) {} ngOnInit() { this.meta_title.setTitle(this.title); this.meta.addTags(this.tags); if (this.metaLinks && this.metaLinks.length > 0) { this.metaLinks.forEach(tag => { this.metaLinkService.addTag(tag, true); }); } } }