Angular UI TinyMCE: how to set default settings

I am using the angular ui tinymce extension. I would like to know how to set the next parameter that I can do in regular JavaScript.

tinymce.init({ selector: "textarea", height: 250, theme: "modern", plugins: [ "advlist autolink lists link image charmap print preview hr anchor pagebreak", "searchreplace wordcount visualblocks visualchars code fullscreen", "insertdatetime media nonbreaking save table contextmenu directionality", "emoticons template paste textcolor" ], toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | print preview media | forecolor backcolor emoticons", image_advtab: true, templates: [ { title: 'Test template 1', content: 'Test 1' }, { title: 'Test template 2', content: 'Test 2' } ] }); 

Not sure how to use the setting

  $scope.tinymceOptions = { setup: function (ed) { ed.onInit.add(function(ed) { //SOME INITIALIZING CODE HERE }); } 

Any help related to setting tinymceOptions would be appreciated.

+4
source share
1 answer

tinymce directive

controller

 var app = angular.module('BDA', ['ui.tinymce']); app.controller('PostCtrl', function ($scope, $http) { $scope.tinymceOptions = { theme: "modern", plugins: [ "advlist autolink lists link image charmap print preview hr anchor pagebreak", "searchreplace wordcount visualblocks visualchars code fullscreen", "insertdatetime media nonbreaking save table contextmenu directionality", "emoticons template paste textcolor" ], toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image", toolbar2: "print preview media | forecolor backcolor emoticons", image_advtab: true, height: "200px", width: "650px" }; }); 

HTML

 <div ng-controller="PostCtrl"> <textarea ui-tinymce="tinymceOptions" ng-model="tinymceModel"></textarea> </div> 
+8
source

Source: https://habr.com/ru/post/1494076/


All Articles