angular-ui / ui-tinymce

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

Allow for global config #275

Closed ChrisMBarr closed 7 years ago

ChrisMBarr commented 8 years ago

This is a very small change that we have to make in our app to allow us to globally configure the options for TinyMCE once instead of doing it again and again in each controller.

Now we can do the following:

angular
  .module("ui.tinymce")
  .config([
      "uiTinymceConfig", (uiTinymceConfig) => {
        uiTinymceConfig.toolbar = "undo redo | bold italic bullist numlist blockquote styleselect removeformat | charmap link | spellchecker";
        uiTinymceConfig.skin = "lightgray";
        uiTinymceConfig.theme = "modern";
        //etc...
    }
  ]);
deeg commented 8 years ago

Thanks, sorry for the late response.

I will look at this today and get it merged in if needed.

deeg commented 7 years ago

I am not sure why this needs to happen. You should still be able to configure it globally if you add a value to the module of your app. For instance in my app I have:

    /**
     * Global tinymce configs
     */
    module.value("uiTinymceConfig", {
        skin: "light",
        skin_url : "styles/skins/light" 
   });

I agree that having it in config might be better, but I don't want to create any breaking changes for people already using it the current way.

Please feel free to comment back on the closed PR, and we can get the change in barring any more information.