Angular component for Trumbowyg 📝
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

angular-trumbowyg

This is an angular component for trumbowyg.

Installing

npm install angular-trumbowyg

Load either ./dist/angular-trumbowyg.js or ./dist/angular-trumbowyg.min.js.

Add trumbowyg as your app's dependency in your app declaration.

Usage

<trumbowyg ng-model="$ctrl.html"
  ng-change="$ctrl.updateHTML()"
  ng-disabled="$ctrl.isInputDisabled"
  placeholder="Start typing some text..."
  options="{btns: [['bold', 'italic'], ['unorderedList', 'orderedList']]}">
</trumbowyg>

This component also supports events that are emitted by the trumbowyg itself. Here's the list of currently supported events:

  • focus
  • blur
  • init
  • change
  • resize
  • paste
  • openfullscreen
  • closefullscreen
  • close

Any of those events can be listened on by specifying an attribute. For example, the following will listen for blur event:

<trumbowyg ng-model="$ctrl.html"
  on-blur="$ctrl.onBlur()"
  options="{btns: [['bold', 'italic'], ['unorderedList', 'orderedList']]}">
</trumbowyg>