ng-admin icon indicating copy to clipboard operation
ng-admin copied to clipboard

Enable textAngular options for wysiwyg field

Open cperryk opened this issue 9 years ago • 2 comments

It would be great to be able to pass textAngular options to a wysiwyg field, like so:

nga.field('post', 'wysiwyg', {
  toolbar: [['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'pre', 'quote']]
})

Or perhaps this would be more consistent with the other fields?

nga.field('post', 'wysiwyg')
  .toolbar([['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'pre', 'quote']])

cperryk avatar May 04 '16 16:05 cperryk

You can configure textAngular in a config block to restrict the tag in the editor :

Example:

.config(function($provide){
    $provide.decorator('taOptions', ['taRegisterTool', '$delegate', function(taRegisterTool, taOptions){

        taOptions.toolbar = [
            ['bold', 'italics', 'underline']
        ];

        return taOptions;
    }]);
}) 

sam2x avatar May 12 '16 12:05 sam2x

Configuration block is great, yet it would force to use the same configuration everywhere. Hence, we should indeed implement a toolbar option as proposed by @cperryk.

jpetitcolas avatar Nov 21 '16 08:11 jpetitcolas