CKEditor directive for Angular.
bower install angular-ckeditor
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" 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.
MIT