how to get formatted html in dialog box

I'm trying to get formatted html with styles and colors from richtexteditor to dialogbox, it is tyling but changed colors are not showing.
I have attached the screenshots and the code i have written is in angularjs form

   <span class="label_value" ng-bind-html="abc">{{abc}}</span>

.js file

  $scope.abc= response.data.abc;







Attachment: Screenshots_38fc754b.rar

1 Reply

PO Prince Oliver Syncfusion Team March 19, 2018 09:07 AM UTC

Hi Shalini, 

Thank you for using Syncfusion products. 

To render the Value in the Dialog control, you can use the setContent method to set the value. Kindly refer to the following code. 

<div class="cols-sample-area" style="height:400px;position:relative;"> 
    <textarea id="rteSample" ej-rte e-width="100%" e-value="rteValue" e-minWidth="150px"></textarea> 
    <br /> 
    <button id="btnOpen" ej-button e-click="openDialog">Open Dialog</button> 
    <div id="dialog" ej-dialog e-title="RTE content" e-close="closeDialog" e-target=".cols-sample-area" e-showOnInit="false"> 
        <span class="label_value" ng-bind-html="rteValue">{{rteValue}}</span> 
    </div> 
</div> 
<script type="text/javascript"> 
    angular.module('syncApp', ['ejangular']).controller('syncCtrl', function ($scope) { 
        $scope.rteValue = "<b>Description</b>: The Rich Text Editor (RTE) control is an easy to render in client side."; 
        $scope.openDialog = function (args) { 
            $("#btnOpen").hide(); 
            var rteObj = $("#rteSample").data("ejRTE"); 
            $("#dialog").ejDialog("open"); 
            $("#dialog").ejDialog("setContent",rteObj.getHtml()); // setting content to the Dialog 
        } 
        $scope.closeDialog=function(args) { 
            $("#btnOpen").show(); 
        } 
    }); 
</script> 
 

Refer to the following link for the Playground sample: https://jsplayground.syncfusion.com/pixkjism  

Regards, 
Prince 


Loader.
Up arrow icon