[英]how to append multiple quill editor with angular and js
我想将多个鹅毛笔编辑器附加到div中。
目标是在帖子类型为1或2时添加合适的模板,并在羽毛笔编辑器中添加每个帖子的内容
但我不知道如何生成多个主轴编辑器,我尝试了以下方法:
$http.post("/getwallpost", reqGetPost).then(function(response) { response.data.forEach(function(item) { if(item.type_id == 1) { var youp = "#" + item.id wallcontent.append("<div id='" + item.id + "'></div>"); new Quill("#" + item.id, optionwall).setContents(JSON.parse(item.content)); } else if(item.type_id == 2) { wallcontent.append('<div class="myArticles">This is article</div>'); } }); });
<div id="wallcontent"> </div>
没关系,它有效。
我将数字用作html ID。 我必须使用“ #sqjdofjez” + item.id之类的字符,而不仅仅是“#5”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.