Search code examples
angularjstinymceangular-ui

Angular UI tinymce errors cannot call method add of undefined


EDIT

If it helps the code that it errors at is

// Update model when calling setContent (such as from the source editor popup)
          setup: function (ed) {
            ed.onSetContent.add(function (ed, o) {   <----Right Here ed is undefined
              if (ed.isDirty()) {
                ed.save();
                ngModel.$setViewValue(elm.val());
                if (!scope.$$phase)
                  scope.$apply();

I'm trying to get a working example of tinymce ported through angular-ui but I keep getting the following error on line 1225 of angular-ui

Cannot call method add of undefined. I just updated my build of angular-ui so I know it's up to date.

I'm calling my scripts in this order

bootstrap css jquery ui css angular-ui css

jquery script

jquery ui script

tiny mce

tiny mce jquery port

angular js

angular ui.js

app.js

controller.js

directives.js

My HTML looks like this

<body ng-app="tinymce">
<textarea ui-tinymce ng-model="tinymce"></textarea>
<body>

and I pass the ui dependecy like so

"use strict";
var app = angular.module('tinymce', ['ui']);

I don't know what else to do.

any ideas?


Solution

  • I've got the same problem, If you are installing using bower, you might be installing tinymce-release 4.0.2. I just found that that version is not working.

    Using bower, the last available version is 3.5.8. I've simple change the version tinymce-release and now it works