Comments (4)
try:
- setup: function (editor) {
+ setup: (editor) => {
from ngx-tinymce.
The type of function, whether standard or fat arrow, is not the issue. The problem is that the addButton
method is now in the ui.registry
namespace which does not seem to be accessible in your project.
I forked your Stackblitz example to show you what I mean.
https://stackblitz.com/edit/ngx-tinymce-uac1n2
config: any = {
height: 250,
...
setup: (editor) => {
editor.ui.registry.addButton('customInsertButton', {
text: 'My Button',
onAction: function (_) {
editor.insertContent(' <strong>It\'s my button!</strong> ');
}
});
}
};
This results in this error:
ERROR
Error: Cannot read property 'registry' of undefined
Is there a way to get this to work? I've looked at your source code and it seems your editor
property does not include the ui
property.
from ngx-tinymce.
You can try using latest version of tinymce via forRoot
, lisk this:
NgxTinymceModule.forRoot({
baseURL: 'https://cdnjs.cloudflare.com/ajax/libs/tinymce/5.7.1/',
})
from ngx-tinymce.
addMenuButton instead of addButton (in version 5.0.15 of tinymce)
from ngx-tinymce.
Related Issues (20)
- bootcss cdn 路径会包含多个 `//` 时无法找到
- Fix package json again HOT 1
- Disabled function is not working HOT 1
- 在ie下使用form-group时无法获取值并且值无法回填 HOT 6
- How to give placeholder HOT 8
- tinymce js文件加载失败 ? HOT 4
- ngx-tinymce组件,第二次打开页面不显示
- ngx-tinymce怎么初始化,tab和reuse这种切换之后就有问题了,是否需要重新初始化一下。 HOT 1
- after installing this lab i got below error while compile on angula 4.4 HOT 1
- 当值为“”空时显示undifined HOT 1
- 开启内联模式时会报错。
- 在ng-zorro的modal中使用,组件会渲染失败 HOT 1
- Get cursor position
- 使用最新的tinymce6.X版本,会报错
- ngx TinyMCE - Get plain text HOT 1
- 延迟加载失效
- Error with latest version - has no exported member 'ɵɵNgModuleDeclaration'. HOT 1
- Fix package.json
- 如何配置图片本地上传 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-tinymce.