simplemde-ng-lib
v0.0.3
Published
Angular library (compatible with ng-cli 6) wrapper for simplemde : https://github.com/sparksuite/simplemde-markdown-editor
Downloads
10
Maintainers
Readme
Info
Note: The code of this project originates from https://github.com/doxiaodong/ng2-simplemde. The reason of creating a separate repo is to build and package a healthy angular library and npm package. Therefore the source structure changed reasonably.
Github: https://github.com/Cha-OS/simplemde-ng-lib
Install:
yarn add simplemde-ng-lib
In your code (best in NgModule file) add:
import { SimplemdeModule, SIMPLEMDE_CONFIG } from 'simplemde-ng-lib';
// ...
var simpleMdeOptions: any = {};
// ...
@NgModule({
// ...
imports: [
SimplemdeModule.forRoot({
provide: SIMPLEMDE_CONFIG,
// config options 1
useValue: simpleMdeOptions
})
],
providers: [],
bootstrap: [AppComponent]
})
In component add:
export class AppComponent {
// ...
public simpleMdeOptionsHtml:any = {};
public markdownValue = "Hello ***World***!\n# Idea\n*This* is an idea!";
}
In your template add:
<simplemde [(ngModel)]="markdownValue" [options]="simpleMdeOptionsHtml"></simplemde>
Example of ussage: