ng-admin
ng-admin copied to clipboard
Enable textAngular options for wysiwyg field
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']])
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;
}]);
})
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.