October 2017
Intermediate to advanced
280 pages
6h 50m
English
Let's take a look at an example of a component called MarkdownPanel. This component will be used in the following way:
<markdown-panel> <panel-title># Title</pane-title> <panel-content> # Content of the panel * First point * Second point </panel-content> </markdown-panel>
The content of each section of the panel will be translated from markdown to HTML. We can delegate this functionality to a service called Markdown:
import * as markdown from 'markdown';
class Markdown {
toHTML(md) {
return markdown.toHTML(md);
}
}
The Markdown service wraps the markdown module in order to make it injectable through the DI mechanism.
Now let's implement MarkdownPanel.
In the following snippet, we can find all the important ...
Read now
Unlock full access