Home > Article > Backend Development > javascript - When using UEditor in angular, the data needs to be bound to the editor to display html.
When using umeditor in angular, you need to bind data to the editor. If you use ng-model, the html tag will be displayed. If you use ng-bind, it will be displayed normally. However, I am using the modal mode box. The first time ng- bind displays normally. After exiting the modal box, clicking in again will display the same as ne-model. The content has html tags. Every time the page is refreshed, ng-bind will only display normally once. I also checked online and found that $sce.trustAsHtml() was used, but it can only be displayed once, the same as ng-bind. This is not what I want. Please help me solve it. Part of the code is as follows:
<code><div class="form-group"> <label>内容</label> <script type="text/plain" id="myEditor" ng-bind="item.contents" style="width:1000px;height:240px;"></script> </div></code>
First time showing
Second display
When using umeditor in angular, you need to bind data to the editor. If you use ng-model, the html tag will be displayed. If you use ng-bind, it will be displayed normally. However, I am using the modal mode box. The first time ng- bind displays normally. After exiting the modal box, clicking in again will display the same as ne-model. The content has html tags. Every time the page is refreshed, ng-bind will only display normally once. I also checked online and found that $sce.trustAsHtml() was used, but it can only be displayed once, the same as ng-bind. This is not what I want. Please ask someone to help me solve it. Part of the code is as follows:
<code><div class="form-group"> <label>内容</label> <script type="text/plain" id="myEditor" ng-bind="item.contents" style="width:1000px;height:240px;"></script> </div></code>
First time showing
Second display