Home  >  Article  >  Backend Development  >  javascript - When using UEditor in angular, the data needs to be bound to the editor to display html.

javascript - When using UEditor in angular, the data needs to be bound to the editor to display html.

WBOY
WBOYOriginal
2016-08-04 09:19:46996browse

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
javascript - When using UEditor in angular, the data needs to be bound to the editor to display html.

Second display
javascript - When using UEditor in angular, the data needs to be bound to the editor to display html.

Reply content:

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
javascript - When using UEditor in angular, the data needs to be bound to the editor to display html.

Second display
javascript - When using UEditor in angular, the data needs to be bound to the editor to display html.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn