5

angular ui tinymce 拡張機能を使用しています。通常の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' }
    ]
});

セットアップの使い方がわからない

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

    });
  }

tinymceOptions の設定に関するヘルプをいただければ幸いです。

4

1 に答える 1

9

tinymce ディレクティブ

コントローラ

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>
于 2013-07-29T18:00:49.773 に答える