【发布时间】:2017-01-13 20:52:57
【问题描述】:
我需要一个富文本区域框来绑定到可淘汰的可观察变量,我尝试使用 Ckseditor 控件,但即使我为 CKSeditor 放置了自定义 KO 绑定,绑定也不起作用。所以我切换回常规的html textarea,然后我可以看到文本的绑定,但是它会显示带有html标签的文本-
<p>This is the scope</p>
我想将 textarea 转换为丰富的 textarea 控件,如 cks 或任何其他控件,有人知道怎么做吗?
<script src="https://cdn.ckeditor.com/4.5.7/standard/ckeditor.js"></script>
<div class="form-group">
<label for="Scope">Scope</label>
<textarea rows="10" name="Scope" class="form-control input-sm" id="Scope" data-bind="value: Scope"></textarea>
</div>
以下是 Knockout 可观察变量代码:
self.Scope = ko.observable("<p>This is the scope</p>");
【问题讨论】:
标签: html knockout.js richtextbox