Javascript 角度UI TinyMCE:如何设置默认设置
我正在使用角度ui tinymce扩展。我想知道如何设置以下设置,我可以在常规JavaScript中进行设置Javascript 角度UI TinyMCE:如何设置默认设置,javascript,angularjs,tinymce,angular-ui,Javascript,Angularjs,Tinymce,Angular Ui,我正在使用角度ui tinymce扩展。我想知道如何设置以下设置,我可以在常规JavaScript中进行设置 tinymce.init({ selector: "textarea", height: 250, theme: "modern", plugins: [ "advlist autolink lists link image charmap print preview hr anchor pagebreak",
tinymce.init({
selector: "textarea",
height: 250,
theme: "modern",
plugins: [
"advlist autolink lists link image charmap print preview hr anchor pagebreak",
"searchreplace wordcount visualblocks visualchars code fullscreen",
"insertdatetime media nonbreaking save table contextmenu directionality",
"emoticons template paste textcolor"
],
toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | print preview media | forecolor backcolor emoticons",
image_advtab: true,
templates: [
{ title: 'Test template 1', content: 'Test 1' },
{ title: 'Test template 2', content: 'Test 2' }
]
});
不确定如何使用该设置
$scope.tinymceOptions =
{
setup: function (ed) {
ed.onInit.add(function(ed) {
//SOME INITIALIZING CODE HERE
});
}
任何与设置tinymceOptions相关的帮助都将不胜感激。
控制器
var app = angular.module('BDA', ['ui.tinymce']);
app.controller('PostCtrl', function ($scope, $http) {
$scope.tinymceOptions = {
theme: "modern",
plugins: [
"advlist autolink lists link image charmap print preview hr anchor pagebreak",
"searchreplace wordcount visualblocks visualchars code fullscreen",
"insertdatetime media nonbreaking save table contextmenu directionality",
"emoticons template paste textcolor"
],
toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
toolbar2: "print preview media | forecolor backcolor emoticons",
image_advtab: true,
height: "200px",
width: "650px"
};
});
HTML
<div ng-controller="PostCtrl">
<textarea ui-tinymce="tinymceOptions" ng-model="tinymceModel"></textarea>
</div>
将其放入指令中。检查Angularjs的指令。谢谢;我不知道如何让链接按钮出现!