ckeditor 工作得很好,只是 ngOnDestroy 处理程序崩溃了。
"dependencies": {
"@angular/common": "8.0.0",
"@angular/compiler": "8.0.0",
"@angular/core": "8.0.0",
"@angular/forms": "8.0.0",
"@angular/platform-browser": "8.0.0",
"@angular/platform-browser-dynamic": "8.0.0",
"@angular/router": "8.0.0",
"@ckeditor/ckeditor5-angular": "1.1.0",
"@ckeditor/ckeditor5-basic-styles": "11.1.4",
"@ckeditor/ckeditor5-build-classic": "12.4.0",
....
"zone.js": "0.10.0"
},
我正在使用带有插件“TerserPlugin”的 webpack 来最小化。问题似乎来自
terserOptions: {
ecma: 6,
ie8: false,
toplevel: true,
module: true,
compress: {
dead_code: true,
warnings: false,
properties: true,
drop_debugger: true,
conditionals: true,
booleans: true,
loops: true,
unused: true,
toplevel: true,
if_return: true,
inline: true,
join_vars: true,
ecma: 6,
module: true,
toplevel: true
},
output: {
comments: false,
beautify: false,
indent_level: 2,
ecma: 6
},
mangle: {
module: true,
toplevel: true
}
}
为了尝试,我以这种方式更改了 polyfills.ts 文件中的 zone.js:
import 'core-js/proposals/reflect-metadata';
import 'zone.js/dist/zone.js';
(window as any).__Zone_disable_toString = true;
require('../manifest.webapp');
但不为我工作。
这是错误:
ERROR TypeError: Cannot read property 'data-ck-expando' of undefined
at Si (4.83409f22a2c74d96c1fe.chunk.js:1)
at Oa._getProxyEmitter (4.83409f22a2c74d96c1fe.chunk.js:1)
at Oa.stopListening (4.83409f22a2c74d96c1fe.chunk.js:1)
at Oa.destroy (4.83409f22a2c74d96c1fe.chunk.js:1)
at Oa.destroy (4.83409f22a2c74d96c1fe.chunk.js:1)
at ea.destroy (4.83409f22a2c74d96c1fe.chunk.js:1)
at Ip.destroy (4.83409f22a2c74d96c1fe.chunk.js:1)
at e.ngOnDestroy (main.83409f22a2c74d96c1fe.bundle.js:1)
at ug (main.83409f22a2c74d96c1fe.bundle.js:1)
at lg (main.83409f22a2c74d96c1fe.bundle.js:1)