/angular-minieditor

A mini text editor for angularjs.

Primary LanguageHTMLMIT LicenseMIT

angular-minieditor

A mini text editor for angularjs.

Dependancies

Recommended to use this editor on angular project

Installation

bower install angular-minieditor

Usage

  • Import script and style files
<link rel="stylesheet" href="/path/to/angular-minieditor.css">
<script src="/path/to/angular-minieditor.js"></script>
  • Import editor module
angular.module('app', ['jerryhsia.minieditor']);
  • Use the directive
<minieditor ng-model="content" options="options"></minieditor>

Directive attributes

Option Description
ng-model REQUIRED - The angular data model
options OPTIONAL-The editor configration

Editor configration options

Attribute Type Description
id String OPTIONAL-The id attribute value
class String OPTIONAL-The class attribute value
width Integer OPTIONAL-The width of editor
height Integer OPTIONAL-The height of editor content
menus Array OPTIONAL-The menu button names

Default buttons

[
    ['bold', 'italic', 'underline', 'strikethrough'],
    ['fontsize'],
    ['justifyleft', 'justifycenter', 'justifyright'],
    ['insertunorderedlist', 'insertorderedlist'],
    ['indent', 'outdent'],
    ['removeformat', 'createlink', 'insertimage']
]

TODO

More button.

Thanks

This editor will continue to develop, and if you like it, please star it, Thanks.