js-angular-markdown
v1.0.1
Published
Markdown component for angular 1.5, uses marked as rendered.
Downloads
2
Maintainers
Readme
Angular markdown component
Markdown component for angular 1.5, uses marked as rendered.
Usage
npm install --save-dev js-angular-markdown
- Import
js-angular-markdown
library and use default imported value as angular module dependency. - 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.