Render your markdown file in Angular with ngx-markdown and HttpClient
Hi everyone. In this article I want to show you how to render markdown content on your website or application from local .md files using ngx-markdown library with HttpClient service in Angular.
ngx-markdown is an Angular library that combines:
Marke...
mbosnjak.hashnode.dev5 min read
Hi Matej,
I'm a bit confused about how you are using the markdown component. You are (1) loading the markdown file (2) calling MarkdownService.compile and (3) showing the content with the <markdown> component.
My understanding is, that the <markdown> component would compile the markdown text internally, so there is no need to call the compile method.
If you call compile, it generates HTML which you can display by setting the innerHtml of a <div> without using the <markdown> tag at all, for example
<div [innerHtml]="markdown"></div>Or am I misunderstanding the ngx-markdown component?
Phil