- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在从事 MEAN 项目。
在后端我需要tinymce来进行cms编辑。
我对每个页面内容使用 ng-view 。但是tiny mce在ng-view中无法工作
这是我的index.html 文件,它工作正常
<html lang="en" ng-app="AdminApp" >
<head>
<script type="text/javascript" src="/asset/tiny/tiny_mce/tiny_mce.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.min.js"></script>
<script type="text/javascript" src="includes/tinymce.js"></script>
<script type="text/javascript">
tinyMCE.init({
// General options
width : "505",
height : "150",
mode : "textareas",
theme : "advanced",
extended_valid_elements : "iframe[src|width|height|name|align|type|class|frameborder]",
plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave,imagemanager",
// Theme options
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,search,replace,|,media,|,bullist,numlist,|,blockquote,|,undo,redo,|,link,unlink,|,",
theme_advanced_buttons2 : "fontsizeselect,forecolor,backcolor,|,preview,fullscreen,code,insertimage",
theme_advanced_buttons3 : "",
theme_advanced_buttons4 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
relative_urls : false,
remove_script_host : false,
document_base_url : "",
// Example content CSS (should be your site CSS)
content_css : "css/content.css",
// Style formats
style_formats : [
{title : 'Bold text', inline : 'b'},
{title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},
{title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},
{title : 'Example 1', inline : 'span', classes : 'example1'},
{title : 'Example 2', inline : 'span', classes : 'example2'},
{title : 'Table styles'},
{title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}
],
// Replace values for the template plugin
template_replace_values : {
username : "Some User",
staffid : "991234"
}
});
</script>
<base href="/admin/" />
</head>
<body>
<!--div ng-view></div-->
<textarea>hello</textarea>
</body>
</html>
ng-view 代码内部
<textarea>home</textarea>
我正在使用node.js服务器
请帮我解决这个问题
谢谢
最佳答案
您不能像在 angularjs
应用程序中那样使用 tinymce
。您应该为此创建第一个指令。
但是已经有您可以使用的指令:https://github.com/angular-ui/ui-tinymce
下载ui-tinymce
后,以下是开始使用它的步骤:
index.html
<!DOCTYPE html>
<head>
<script type="text/javascript" src="bower_components/tinymce-dist/tinymce.js"></script>
<script type="text/javascript" src="bower_components/angular/angular.js"></script>
<script type="text/javascript" src="bower_components/angular-ui-tinymce/src/tinymce.js"></script>
<script type="text/javascript" src="app.js"></script>
</head>
<body ng-app="myApp">
<form method="post" ng-controller="TinyMceController">
<textarea ui-tinymce="tinymceOptions" ng-model="tinymceModel"></textarea>
<button ng-click="getContent()">Get content</button>
<button ng-click="setContent()">Set content</button>
</form>
</body>
app.js
var myAppModule = angular.module('myApp', ['ui.tinymce']);
myAppModule.controller('TinyMceController', function($scope) {
$scope.tinymceModel = 'Initial content';
$scope.getContent = function() {
console.log('Editor content:', $scope.tinymceModel);
};
$scope.setContent = function() {
$scope.tinymceModel = 'Time: ' + (new Date());
};
$scope.tinymceOptions = {
plugins: 'link image code',
toolbar: 'undo redo | bold italic | alignleft aligncenter alignright | code'
};
});
关于angularjs - tinymce 不在 ng-view 内工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43534554/
因为没有更多的 Tinymce 论坛,如果我可以问有没有办法通过在源代码中添加 style="width: or height:"来关闭表格功能。 谢谢 最佳答案 我通过将以下内容添加到 tinymc
我的页面加载了 5 个 div,可以使用 Tinymce 内联编辑器进行编辑。通过单击一个按钮(如此动态),我可以安心地使用 Jquery 加载 5 个新的。但是当然新的不会受到 Tinymce 的影
我想以相同的形式使用 2 个不同的 textareas 和 tinyMCE。第一个效果很好,但是每当我添加第二个时,第二个都会被禁用(当我从右下角手动放大时它会启用)。它们的字段名称和 id 是不同的
我不确定我是否理解正确,但我相信有一个免费的“基本”版本,如果您需要一些高级插件和技术支持,您只需付费。 情况真的是这样吗? 最佳答案 是 . 请查看 this link和 this link想要查询
我的一位用户对tinyMCE 中的撤消功能感到非常沮丧。它不是撤消最后一个微小的更改,而是撤消许多更改。这是每隔几秒拍摄一次快照的计时问题吗?这是可配置的吗? 其他信息:用户正在将信息从 Word 复
我有最新版本的 TinyMCE 编辑器,当我像那样传递图像链接时 http://www.w3schools.com/css/trolltunga.jpg它会自动转换为 .我试图捕获 paste_pr
如果编辑器当前内容的长度加上要粘贴的单词的长度超过指定的限制,我需要阻止tinyMCE的粘贴事件。我该怎么做?谢谢。 最佳答案 我错了。我不需要阻止或禁用 tinyMCE 中的粘贴来执行此操作。我使用
我正在使用 TinyMCE 插件并将 valid_elements 选项设置为: "a[href|target:_blank],strong/b,em/i,br,p,ul,ol,li" 即使没有列出数
我似乎无法在互联网上找到有关此的任何信息,但是 TinyMCE 4 中的图标如何工作? 我知道我可以按名称为按钮指定图标并为我的自定义按钮指定自定义图标,但是如果我想采用标准图标之一,在图像编辑应用程
每次我向 tinyMCE 添加图像时,它都会将图像 URL 转换为愚蠢的内容(删除主机名并添加 ../或任何它需要的内容),因此我将无法在任何其他级别使用 tinymce 创建的图像地点 ! 这可以以
我有一个包含多个文本区域的页面,可以用 TinyMCE 替换。 一些 Textareas 采用阿拉伯语文本,一些英语文本。 textareas 根据他们应该接收的输入正确设置了 dir -属性。 如何
我正在使用最新的 TinyMCE,它很棒,但我遇到的唯一问题是人们发布代码示例时。他们以 PRE 格式发布还是正常发布都没有关系。 TinyMCE 去掉了所有的缩进(Tabs)并使其难以阅读,这里有没
我一直在寻找几个小时来找到一个可以在图像中添加诸如“填充:5px”之类的东西的插件。每个人都通过纯 html 做到这一点吗?我们的客户需要一种方法来简单地使用按钮或右键单击上下文菜单来添加它。有什么建
我想要 tinymce 工具栏中的按钮。单击该按钮后,无论光标在哪里,“HELLO”都应出现在编辑器中。 版本:3.3.7 但我无法添加该按钮。 我试过添加这样的按钮 setup: function
我刚开始使用 TinyMCE 作为 WYSIWYG 编辑器,我想知道是否有人看到我的问题使用过这个不错的编辑器可以帮助我,这是我的脚本: tinyMCE.init({ mode :
我正在尝试从 ltr 设置 TinyMCE(版本 4.0.12)中的默认内容方向至 rtl . 我正在使用 directionality配置: directionality: 'rtl', ...但编
如何为粗体、下划线和删除线等基本内容覆盖 TinyMCE 的默认格式?目前生成的 HTML 使用样式化的跨度,这通常很好。不幸的是,在这种情况下,我需要做一些简单的解析并且需要元素是旧样式的 、 和
如何在 TinyMCE 中设置默认字体大小和背景颜色? 谢谢, 伊甸园 最佳答案 您也可以使用 Javascript 更改 css。 将此添加到您的 init 函数中: oninit : "postI
当我使用 TinyMCE 添加新表格时,表格几乎不可见,因为初始宽度只有几个像素。 有什么办法可以改变这种情况吗? 最佳答案 打开 table.js,转到第 30 行有内容 width = formO
我正在 TinyMCE 工具栏上制作一个额外的按钮(它用于 Wordpress,但我认为这并不重要)。 按下按钮并显示一个表单,我在配置它时完全不知所措,以便在表单上输入的值实际上传输到tinyMce
我是一名优秀的程序员,十分优秀!