angular-ui / ui-tinymce

AngularUI wrapper for TinyMCE
MIT License
488 stars 371 forks source link

tinymce Option not working inside a custom directive #361

Open Naenil opened 6 years ago

Naenil commented 6 years ago

So I have the following proble: I set up the following options in my controller:

scope.tinymceOptions =
{
    toolbar:
        'bold italic | link image | alignleft aligncenter alignright',
    menubar: false
};

(scope being the way the scope is defined in the directive)

template-side, I have the following:

<div ng-if="!!tinymceOptions">
            <textarea  ui-tinymce="tinymceOptions" ng-model="tinymceModel" ></textarea>
    </div>

So the tag wrapped around a ngif to make sure tinymceOptions actually exists.

However, what I see is the following:

screenshot

I tried a few options already: Obviously changing the options themselves, checking if tinymce is loaded, applying the options directly within the html.. is that a normal behavior?

juliaclement commented 5 years ago

I've found that the only way to get ui-tinymce to recognize my options is to explicitly restate the controller in the textarea: <textarea ui-tinymce="tinymceOptions" ng-model="activeObject.Description" ng-controller="ApplicationCtrl"> where ApplicationCtrl is the controller I'm using (In this case the master one for the app)