I'm using text-angular to save html-based content into database and i want to save checkboxes with the checked attribute on them. I've tried to use the input field like below but text-angular doesnt render checkboxes with checked attribute. Is there any way to do this without doing pure css checkboxes?
<input type="checkbox" checked>
EDIT: The code I am using:
<text-angular data-ng-model="example_content" placeholder="Content..."
rows="5">
And inside the textarea of the text-angular directive, I am trying to insert the input from above but it renders without checked attribute
I looked up in
text-angular's sanitizer librarytextAngular-sanitize.jsto find out that thecheckedattribute isn't part of theirhtmlAttrsattribute map.Hence, the only option we're left with is to override the sanitizer JS file with the edit. Moreover, you can add other attributes/tags if you want (Do consider vulnerabilities though!)
Here's the working example plunker forked from official
text-Angularplunker. Notice theta-sanitize.jsincluded in plunker which is modified version of theirtextAngular-sanitize.jsHope this helps!