Another markdown wrapper component for Angular, build with simplicity and clarity in mind.
Note that by default, it use marked.js
as the parser (that's why this project called), see below to use your own parser.
npm i -P @angeeks/md
// app.module.ts
+import { MdModule } from '@angeeks/md';
@NgModule({
imports: [
+ MdModule
]
})
export class AppModule {}
<!-- app.component.html -->
<ngk-md [src]='src'></ngk-md>
<!-- or if you type fast -->
<ngk-markdown [src]='src'></ngk-markdown>
// app.module.ts
+import { mdParser, Parser } from '@angeeks/md';
+export function yourMarkdownParser(): Parser {
+ return { parse };
+}
@NgModule({
imports: [
MdModule
],
providers: [
+ { provide: mdParser, useFactory: yourMarkdownParser }
]
}
})
export class AppModule {}