I am developer from Croatia. With high interest in web development, blogging and exploring new stuff, I am also cyclists and chess player. Feel free to reach out :)
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 Jollans
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