我在我的 Angular 7 应用程序中使用 TinyMCE 编辑器组件。当我将模板变量插入编辑器时:
<span class="data-variable">${variable_name}</span>
它可以用我初始化 tinymce 的 template_replace_values 对象中的值替换。
let template_replace_values = {variable_name: "hello world!"}
输出:
<span class="data-variable">hello world!</span>
但是,当模板 html 通过 ngModel 绑定填充时:
<editor #editor [(ngModel)]="html" (onChange)="updateStore(html)"></editor>
html 被插入如下:
<span class="data-variable">${variable_name}</span>
并且没有更换发生。我是否需要从角度生命周期中以某种方式挂钩到 tinymce 事件?