Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

Latest commit

 

History

History
60 lines (43 loc) · 1.43 KB

README.md

File metadata and controls

60 lines (43 loc) · 1.43 KB

angular-ckeditor

Build Status Dependency Status devDependency Status

CKEditor directive for Angular.

Install

Using bower

bower install angular-ckeditor

Usage

HTML:

<!-- Load files. -->
<script src="angular.js"></script>
<script src="angular-ckeditor.js"></script>

<div ng-controller="CkeditorCtrl">
  <div ckeditor="options" ng-model="content" ready="onReady()"></div>
</div>

JavaScript:

angular.module('controllers.ckeditor', ['ckeditor'])
.controller('CkeditorCtrl', function ($scope) {

  // Editor options.
  $scope.options = {
    language: 'en',
    allowedContent: true,
    entities: false
  };

  // Called when the editor is completely ready.
  $scope.onReady = function () {
    // ...
  };
});

"ckeditor" directive

  • "ckeditor" Specify editor options. Accepts an Object.
  • "ng-model" Binded scope variable.
  • "ready" Called when the editor is completely ready. Accepts an Angular expression.
  • Inline editing mode is enabled if element has a contenteditable attribute set to true.

License

MIT