0.1.3 • Published 6 years ago
aurelia-tinymce v0.1.3
aurelia TinyMCE
Aurelia TinyMCE HTML Editor Plugin
Installation
- npm install aurelia-tinymce --save
- (aurelia-cli) add package to the dependencies in the aurelia.json file.
{
"name": "aurelia-tinymce",
"path": "../node_modules/aurelia-tinymce/dist/amd",
"main": "index",
"deps": [
"./tinymce/tinymce"
],
"resources": [
"**/*.{css,html}"
]
}
- create a
fonts
andimg
directory in the root of your project (if you dont already have them). - copy the contents of
node_modules/aurelia-tinymce/dist/amd/tinymce/fonts
to thefonts
folder you created. - copy the contents of
node_modules/aurelia-tinymce/dist/amd/tinymce/img
to theimg
folder you created.
Usage
- add the plugin to your main.ts file.
import {Aurelia} from 'aurelia-framework'
import environment from './environment';
export function configure(aurelia: Aurelia) {
aurelia.use
.standardConfiguration()
.plugin('aurelia-tinymce') //<-- This line
.feature('resources');
if (environment.debug) {
aurelia.use.developmentLogging();
}
if (environment.testing) {
aurelia.use.plugin('aurelia-testing');
}
aurelia.start().then(() => aurelia.setRoot());
}
- add the element to the view where you want to editor to go.
<template>
<h1>My Html Editor</h1>
<tiny-mce theme="mobile" menubar="false" content="hello world" save.delegate="saveContent($event)"></tiny-mce> <!--This line-->
</template>