我有CkEditor的指令。我只需要在指令中配置ckeditor工具栏,需要帮助......这是我的指令
.directive('fosCkEditor', ['$compile',
function($compile) {
return {
require: '?ngModel',
link: function ($scope, elm, attr, ngModel) {
var ck = CKEDITOR.replace(elm[0]);
ck.on('pasteState', function () {
$scope.$apply(function () {
ngModel.$setViewValue(ck.getData());
});
});
ngModel.$render = function (value) {
ck.setData(ngModel.$modelValue);
};
}
};
}
]);
答案 0 :(得分:0)
为什么不使用 ng-ckeditor ?:
http://issuetracker.unity3d.com/issues/particle-system-plays-only-once
来自ng-ckeditor docs:
<textarea ckeditor="editorOptions" ng-model="modelName"></textarea>
// add dependency
angular.module('app', ['ngCkeditor'])
// setup editor options
$scope.editorOptions = {
language: 'ru',
uiColor: '#000000'
};