I am inserting this content for a button
<button type="button">Click Me!</button>
xxxxxx
After clicking saving this content i am getting a raw data which is getting saved in db
<p><span class="highLT"><</span><span class="highELE">button</span> <span class="highATT">type=</span><span class="highVAL">"button"</span><span class="highGT">></span>Click Me!<span class="highLT"><</span><span class="highELE">/button</span><span class="highGT">></span></p>
<p><strong><span class="highGT"> xxxxxx</span></strong></p>
Instead of this what i want is plain html content
@deeg very true this thing i know but the trouble is i am inserting html tag as a plain text in editor and in db it is getting saved as
<p><span class="highLT"><</span><span class="highELE">button</span> <span class="highATT">type=</span><span class="highVAL">"button"</span><span class="highGT">></span>Click Me!<span class="highLT"><</span><span class="highELE">/button</span><span class="highGT">></span></p>
<p><strong><span class="highGT"> xxxxxx</span></strong></p>
If i can get the string contains html then i can use $sce.trustAsHtml() and displayed it in div
I am typing html content into editor not inserting via angular
Editor
instance upon setup
into an array within the scope. Then, when the "edit" button is clicked, I call the setMode
method on all Editor
instances stored in the array. This makes the code a bit more easier to read and it avoids having to emit/broadcast the TinyMCE. One minor issue however is that when updating the mode of all Editor
instances, it calls $apply
too many times causing Angular to throw the $apply already in progress
error.
This is the expected markup which is created dynamically
<textarea data-ng-model="cv.experience[content.title]"></textarea>
<textarea data-ng-model="cv.experience[content.title]"></textarea>
This is the sample of the JSON I want to achieve
experience:{
content:[
{
header:String,
title:String,
start_date:Date,
end_date:Date,
location:String,
description:String
},
{
header:String,
title:String,
start_date:Date,
end_date:Date,
location:String,
description:String
},
....
]
}
How can i archive above structure using ** ng-model **