TinyMCE <textarea> two way bound with AngularJS

前端 未结 3 1185
被撕碎了的回忆
被撕碎了的回忆 2021-01-06 23:55

Is it possible to apply two way binding to a that has had TinyMCE applied to it for Rich Text Formatting.

I can\'t get

3条回答
  •  暖寄归人
    2021-01-07 00:35

    Also compare the render function from the directive above to this render function from angular-ui-tinymce ( https://github.com/angular-ui/ui-tinymce )

    ngModel.$render = function() {
      if (!tinyInstance) {
        tinyInstance = tinymce.get(attrs.id);
      }
      if (tinyInstance) {
        tinyInstance.setContent(ngModel.$viewValue || '');
      }
    

    Plnkr: http://plnkr.co/edit/04AFkp?p=preview

    However depending on the timing of the loading of your DOM you may need to set the priority on your directive upwards. :-)

提交回复
热议问题