frontend-tutorial-framework/src/app/markdown.service.ts
2017-12-18 17:49:57 +01:00

15 lines
301 B
TypeScript

import { Injectable } from '@angular/core';
import { Converter } from 'showdown';
@Injectable()
export class MarkdownService {
private converter: Converter;
constructor() {
this.converter = new Converter();
}
convertToHtml(text: string) {
return this.converter.makeHtml(text);
}
}