import { Injectable } from '@angular/core' ; import { IConfig } from '../../../../../../shared/models/IConfig' ; import { MarkdownService } from './markdown.service' ; import { ConfigService } from './data.service' ; @ Injectable ( ) export class ImprintAndInfoService { constructor ( private service , private mdService ) { } param { string } type returns { Promise < string > } async loadConfig ( type ) { let configRendered = '' ; try { const config = < IConfig > < any > await this . service . readSingleItem ( 'public/' + type ) ; configRendered = this . renderHtml ( config ) ; } catch ( error ) { configRendered = '' ; } return configRendered ; } renderHtml ( config ) { return this . mdService . render ( config . value ) || 'No Content yet!' ; } }