AngularJS Render HTML in textarea

xyonme

I need to render HTML values in text area SUBMIT FORM. I can bind the html values in a <div> but not in a <textarea>. Also, ng-model for data binding can retrieve the value but it is displayed as html.

Controller

//task.descr contains "<br>-------<br><a href="http://www.google.com"..."
var str="<br><hr><br>"+ task.descr;
//str= $sce.trustAsHtml(str);
$scope.formData5 = {
    descr: str}
console.log($scope.formData5);


<textarea placeholder="Deskripsi Memo"  name="descr" 
ngMaxlength="1000" ng-model="formData5.descr" 
ng-bind-html="formData5.descr" > </textarea>
mohamedrias

This would allow you have both two way data binding as well as give you the functionality of textarea:

  <div ng-bind-html="modelname"
         contenteditable="true"
         ng-model="modelname">
    </div>

DEMO

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to render raw html with AngularJS?

From Dev

Render json instead of html with angularjs

From Dev

How to render text into HTML in AngularJS

From Dev

How to render html in Angularjs directive?

From Dev

Angularjs render html in special characters

From Dev

How to render raw html with AngularJS?

From Dev

AngularJS + Json: How to render html

From Dev

HTML View Postgresql TextArea render line breaks or paragraphs -python flask

From Dev

AngularJS-Render HTML embed codes as a layout

From Dev

Render Razor variable inside AngularJS Html

From Dev

AngularJS - Render HTML tags that are contained in a string

From Dev

MVC, Render HTML page which includes AngularJS

From Dev

Render Razor variable inside AngularJS Html

From Dev

AngularJS: How to render HTML in $scope variable in view?

From Dev

Twig render a textarea

From Dev

Live render of text in a textarea

From Dev

How to render a HTML tag from json value using angularJs

From Dev

AngularJS render HTML within double curly brace notation

From Dev

Why doesn't HTML render when passed from AngularJS?

From Dev

How would I render html tags inserted via compile in AngularJS?

From Dev

vuejs v-html render bingding value delayed: must trigger with a mouse click in and out of textarea control

From Dev

How to render array of lines to <textarea>?

From Dev

textarea doesn't render correctly

From Dev

Render line breaks entered in textarea

From Dev

Tinymce textarea not working with AngularJS

From Dev

Getting value of TextArea angularjs

From Dev

angularjs : @mention in textarea

From Dev

Tinymce textarea not working with AngularJS

From Dev

AngularJS - expandable textarea

Related Related

HotTag

Archive