so the goal is to edit some text with tinymce, persist it and display it in a div using angularJS with the same html, style formating.
I'm using tinymce 3.5.8 with angularUI directive, I've managed to save the content of the wysiwyg in my database (mySQL, TEXT). I'm retrieving it through Spring as a String and send it back to the angularJS app.
I've tried putting a
<div ng-bind-html-unsafe="myModel">
where myModel is defined as
$scope.myModel = Projet.get(getting the json somewhere);
but tags are not interpreted as html, they just print like
<p><span style="color #ff9900;>Texte de test</span></p>.
I've also tried with ngSanitize and ng-bind-html.
html :
<div class="content-swipe-box">
<h3>Contexte</h3>
<div ng-bind-html-unsafe="projet.contexte"></div>
</div>
controller :
$scope.projet = ProjetService.getProject($routeParams.projectId);
Database entry (TEXT)
<p><span style="color: #ff9900;">aaaaa</span></p>
<p>&nbsp;</p>
directive (that's the angularui directive where I've added options):
...
link: function (scope, elm, attrs, ngModel) {
var expression, options, tinyInstance;
// generate an ID if not present
if (!attrs.id) {
attrs.$set('id', 'uiTinymce' + generatedIds++);
}
options = {
skin:"bootstrap",
theme_advanced_disable:"styleselect, anchor",
plugins : "advlist, fullscreen, preview",
theme_advanced_buttons1:"bold, italic, underline, justifyleft, justifycenter, justifyright, justifyfull, formatselect, fontselect, fontsizeselect, forecolor",
theme_advanced_buttons2:"bullist, numlist, outdent, indent, undo, redo, link, unlink, image, cleanup, code, blockquote, hr,removeformat,visualaid,separator,charmap, preview, fullscreen ",
theme_advanced_resizing: true,
theme_advanced_resize_horizontal : false,
force_br_newlines : true,
force_p_newlines : false,
Thank you for your help !