1.0.1 • Published 8 years ago

js-angular-markdown v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
8 years ago

Angular markdown component

Markdown component for angular 1.5, uses marked as rendered.

Usage

  1. npm install --save-dev js-angular-markdown
  2. Import js-angular-markdown library and use default imported value as angular module dependency.
  3. Use markdown element in you templates.

Important this component uses UMD and requires angular package.

Example usage

import angular from 'angular';
import markdown from 'js-angular-markdown';

const module = angular.module('example', [markdown]);

module.component('example', {
    template: `
        <markdown content="$ctrl.content" options="$ctrl.options"></markdown>
    `,
    controller: class {
        constructor(){
            this.content = '# Hello!';
            this.options = {}; // It's totally optional. See available options in https://github.com/chjj/marked
        }
    }
});

export default module.name;

License

MIT, see more in LICENSE file.