I am interested in adding multiple Quill editors to a div using the append function.
My objective is to add the appropriate template when the post type is either 1 or 2, and then attach a Quill editor with the relevant content for each of these posts.
However, I'm struggling to figure out how to generate multiple Quill editors. Here is what I have tried:
$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>