ckeditor / ckeditor5-angular

Official CKEditor 5 Angular 5+ component.
https://ckeditor.com/ckeditor-5
Other
202 stars 110 forks source link

Error: this.editor.create is not a function #411

Open psrikar045 opened 6 months ago

psrikar045 commented 6 months ago

core.js:6210 ERROR Error: Uncaught (in promise): TypeError: this.editor.create is not a function TypeError: this.editor.create is not a function at CKEditorComponent._callee2$ (ckeditor-ckeditor5-angular.js:254:50) at tryCatch (ckeditor-ckeditor5-angular.js:2:1) at Generator. (ckeditor-ckeditor5-angular.js:2:1) at Generator.next (ckeditor-ckeditor5-angular.js:2:1) at tslib.es6.js:76:1 at new ZoneAwarePromise (zone.js:913:33) at __awaiter (tslib.es6.js:72:1) at ckeditor-ckeditor5-angular.js:252:65 at ZoneDelegate.invoke (zone.js:386:30) at Zone.run (zone.js:143:47) at resolvePromise (zone.js:832:39) at resolvePromise (zone.js:784:21) at zone.js:894:21 at ZoneDelegate.invokeTask (zone.js:421:35) at Object.onInvokeTask (core.js:28578:33) at ZoneDelegate.invokeTask (zone.js:420:40) at Zone.runTask (zone.js:188:51) at drainMicroTaskQueue (zone.js:601:39)

html: <ckeditor [editor]="Editor" [config]="config" [(ngModel)]="htmlData"> ts: import custombuild from '../../../assets/lib/core/build/ckeditor'

public Editor = custombuild; public htmlData = '

Data from html


heading 1' public config ={ toolbar: { items: [ 'exportPDF', 'exportWord', '|', 'findAndReplace', 'selectAll', '|', 'heading', '|', 'bold', 'italic', 'strikethrough', 'underline', 'code', 'subscript', 'superscript', 'removeFormat', '|', 'bulletedList', 'numberedList', 'todoList', '|', 'outdent', 'indent', '|', 'undo', 'redo', '-', 'fontSize', 'fontFamily', 'fontColor', 'fontBackgroundColor', 'highlight', '|', 'alignment', '|', 'link', 'insertImage', 'blockQuote', 'insertTable', 'mediaEmbed', 'codeBlock', 'htmlEmbed', '|', 'specialCharacters', 'horizontalLine', 'pageBreak', '|', 'textPartLanguage', '|', 'sourceEditing' ], shouldNotGroupWhenFull: true }, list: { properties: { styles: true, startIndex: true, reversed: true } }, heading: { options: [ { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' }, { model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' }, { model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' }, { model: 'heading3', view: 'h3', title: 'Heading 3', class: 'ck-heading_heading3' }, { model: 'heading4', view: 'h4', title: 'Heading 4', class: 'ck-heading_heading4' }, { model: 'heading5', view: 'h5', title: 'Heading 5', class: 'ck-heading_heading5' }, { model: 'heading6', view: 'h6', title: 'Heading 6', class: 'ck-heading_heading6' } ] }, placeholder: '', fontFamily: { options: [ 'default', 'Arial, Helvetica, sans-serif', 'Courier New, Courier, monospace', 'Georgia, serif', 'Lucida Sans Unicode, Lucida Grande, sans-serif', 'Tahoma, Geneva, sans-serif', 'Times New Roman, Times, serif', 'Trebuchet MS, Helvetica, sans-serif', 'Verdana, Geneva, sans-serif' ], supportAllValues: true }, fontSize: { options: [10, 12, 14, 'default', 18, 20, 22], supportAllValues: true }, htmlSupport: { allow: [ { name: /.*/, attributes: true, classes: true, styles: true } ] }, htmlEmbed: { showPreviews: true }, link: { decorators: { addTargetToExternalLinks: true, defaultProtocol: 'https://', toggleDownloadable: { mode: 'manual', label: 'Downloadable', attributes: { download: 'file' } } } }, mention: { feeds: [ { marker: '@', feed: [ '@apple', '@bears', '@brownie', '@cake', '@cake', '@candy', '@canes', '@chocolate', '@cookie', '@cotton', '@cream', '@cupcake', '@danish', '@donut', '@dragée', '@fruitcake', '@gingerbread', '@gummi', '@ice', '@jelly-o', '@liquorice', '@macaroon', '@marzipan', '@oat', '@pie', '@plum', '@pudding', '@sesame', '@snaps', '@soufflé', '@sugar', '@sweet', '@topping', '@wafer' ], minimumCharacters: 1 } ] }, removePlugins: [ 'CKBox', 'CKFinder', // 'EasyImage', 'RealTimeCollaborativeComments', 'RealTimeCollaborativeTrackChanges', 'RealTimeCollaborativeRevisionHistory', 'PresenceList', 'Comments', 'TrackChanges', 'TrackChangesData', 'RevisionHistory', 'Pagination', 'WProofreader', 'MathType' ] } version used: "@ckeditor/ckeditor5-angular": "^4.0.0",

ts config: { "compileOnSave": false, "compilerOptions": { "baseUrl": "./", "outDir": "./dist/out-tsc", "sourceMap": true, "declaration": false, "downlevelIteration": true, "experimentalDecorators": true, "moduleResolution": "node", "resolveJsonModule": true, "emitDecoratorMetadata": true, "importHelpers": true, "skipLibCheck":true, "typeRoots": [ "node_modules/@types" ], "target": "es5", "module": "es2020", "lib": [ "es2018", "dom" ], "allowSyntheticDefaultImports": true }, "angularCompilerOptions": { "fullTemplateTypeCheck": true, "strictInjectionParameters": true, "ivy":false } }