aurelia-trumbowyg-plugin
v0.1.7
Published
A trumbowyg wrapper for Aurelia.
Downloads
370
Readme
aurelia-trumbowyg-plugin
Install
npm i jquery trumbowyg aurelia-trumbowyg-plugin
Bundle (CLI requirejs)
"jquery",
{
"name": "trumbowyg",
"path": "../node_modules/trumbowyg/dist",
"main": "trumbowyg",
"deps": ["jquery"],
"resources": [
"ui/trumbowyg.css"
]
},
{
"name": "aurelia-trumbowyg-plugin",
"path": "../node_modules/aurelia-trumbowyg-plugin/dist/amd",
"main": "index"
}
Register
aurelia.use.plugin('aurelia-trumbowyg-plugin');
WebPack
import svgPath from 'trumbowyg/dist/ui/icons.svg';
...
aurelia.use.plugin(PLATFORM.moduleName('aurelia-trumbowyg-plugin'), {svgPath});
...
Usage
<require from="trumbowyg/ui/trumbowyg.css"></require>
<trumbowyg-editor value.bind="message"></trumbowyg-editor>
Options
For global options pass a trumbowyg config object when registering the plugin:
let options = {
/* trumbowyg options */
};
aurelia.use.plugin('aurelia-trumbowyg-plugin', options);
If you want per-instance options use the bindable options
property:
<trumbowyg-editor value.bind="content"
options.bind="{ /* trumbowyg options */ }">
</trumbowyg-editor>