我们如何在AngULAR 6中的ckeditor中集成ckfinder?

时间:2019-02-20 07:40:53

标签: angular ckeditor ckfinder

嗨,我一直在尝试将ckeditor5与angular app集成在一起,并按照 文档。

https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/frameworks/angular.html

https://ckeditor.com/docs/ckeditor5/latest/features/image-upload/ckfinder.html

正常的ckeditor5正在工作,但是当我尝试启用ckfinder时,它没有工作。 具体来说,我正在尝试将图像上传到服务器,并且需要执行一些基本操作,例如图像解析 在CKFinder中提到。 根据文档,当我们单击ckfinder按钮时,它应该打开模式框,但现在它没有打开“

提前感谢您的时间

我正在粘贴文件以供参考

app.component.html

<ckeditor
[(ngModel)]="model.editorData"
[editor]="Editor"
[config]="{
toolbar: ['ckfinder'],
ckfinder: {
  options: {
    resourceType: 'Images'
  },
  uploadUrl: 'http://localhost:3000/test/upload/iamge'
 }
}"
></ckeditor>

app.component.ts

import { Component } from '@angular/core';
import * as ClassicEditor from '@ckeditor/ckeditor5-build-classic';

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})

export class AppComponent {
title = 'ckeditor2';

public Editor = ClassicEditor;
public model = {
 editorData: '<p>Hello, world!</p>'
};}

app.module.ts

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { HttpClientModule } from '@angular/common/http';
import { CKEditorModule } from '@ckeditor/ckeditor5-angular';

@NgModule({
   declarations: [AppComponent],
   imports: [
     BrowserModule,
     AppRoutingModule,
     FormsModule,
     NgxEditorModule,
     HttpClientModule,
     AngularFontAwesomeModule,
     CKEditorModule
 ],
 providers: [],
 bootstrap: [AppComponent]
  })
export class AppModule {}

enter image description here

1 个答案:

答案 0 :(得分:0)

只需包含

<script src="ckeditor.com/apps/ckfinder/3.4.5/ckfinder.js"></script> 

插入index.html文件,它将起作用!