code: function (ed) {
              ed.onSetContent.add(function (ed, o) {
                if (ed.isDirty()) {
                  ed.save();
                  ngModel.$setViewValue(elm.val());
                  scope.$apply();
                }
              });
            }
docs: Update model when calling setContent (such as from the source editor popup)