/**
 * Binds a TinyMCE widget to <textarea> elements.
 */
angular.module('ui.tinymce', [])
  .value('uiTinymceConfig', {})
  .directive('uiTinymce', ['$rootScope', '$window', 'uiTinymceConfig', function($rootScope, $window, uiTinymceConfig) {
    uiTinymceConfig = uiTinymceConfig || {};
    var generatedIds = 0;
    return {
      require: 'ngModel',
      link: function(scope, element, attrs, ngModel) {
        if (!$window.tinymce) {
          return;
        }

        var expression, options, tinyInstance,
          updateView = function(editor) {
            if (options.raw === true) {
              ngModel.$setViewValue(editor.getContent({format: 'text'}).trim());
            } else {
              ngModel.$setViewValue(editor.getContent().trim());
            }
            if (!$rootScope.$$phase) {
              scope.$apply();
            }
            if (angular.isFunction(options.onChange)) {
              options.onChange();
            }
          };

        // generate an ID if not present
        if (!attrs.id) {
          attrs.$set('id', 'uiTinymce' + generatedIds++);
        }

        expression = {};

        angular.extend(expression, scope.$eval(attrs.uiTinymce));

        // make config'ed setup method available
        if (expression.setup) {
          var configSetup = expression.setup;
          delete expression.setup;
        }

        options = {
          // Update model when calling setContent (such as from the source editor popup)
          setup: function(ed) {
            ed.on('init', function() {
              ngModel.$render();
              ngModel.$setPristine();
            });
            // Update model on button click
            ed.on('ExecCommand', function() {
              ed.save();
              updateView(ed);
            });
            // Update model on change
            ed.on('change', function(e) {
              if (!e.originalEvent) {
                ed.save();
                updateView(ed);
              }
            });
            ed.on('blur', function() {
              element[0].blur();
            });
            // Update model when an object has been resized (table, image)
            ed.on('ObjectResized', function() {
              ed.save();
              updateView(ed);
            });
            if (configSetup) {
              configSetup(ed, {
                updateView: updateView
              });
            }
          },
          selector: '#' + attrs.id
        };
        // extend options with initial uiTinymceConfig and options from directive attribute value
        angular.extend(options, uiTinymceConfig, expression);
        tinymce.init(options);

        ngModel.$formatters.unshift(function(modelValue) {
          return modelValue || '';
        });

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

          var format = options.raw ? 'text' : 'raw';

          // tinymce replaces "\r\n" to "\n", so we have to do the same on model value
          if (tinyInstance &&
            tinyInstance.getContent({format: format}).trim() !== ngModel.$viewValue.replace(/\r\n/g, '\n')
          ) {
            tinyInstance.setContent(ngModel.$viewValue);
          }
        };

        scope.$on('$destroy', function() {
          if (!tinyInstance) { tinyInstance = tinymce.get(attrs.id); }
          if (tinyInstance) {
            tinyInstance.remove();
            tinyInstance = null;
          }
        });
      }
    };
  }]);

@@ -1205,181 +1205,8 @@
 );%0A%0A
-        // make config'ed setup method available%0A        if (expression.setup) %7B%0A          var configSetup = expression.setup;%0A          delete expression.setup;%0A        %7D%0A%0A
     
@@ -2136,23 +2136,28 @@
     if (
-configS
+expression.s
 etup) %7B%0A
@@ -2174,15 +2174,20 @@
     
-configS
+expression.s
 etup

Change to consume expression.setup directly from new object