simplemde-ng-lib
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

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:

Package Sidebar

Install

npm i simplemde-ng-lib

Weekly Downloads

5

Version

0.0.3

License

MIT

Unpacked Size

325 kB

Total Files

26

Last publish

Collaborators

  • mprinc