angular - 我们如何在 ANGULAR 6 中将 ckfinder 集成到 ckeditor 中?
问题描述
嗨,我一直在尝试将 ckeditor5 与 Angular 应用程序集成,并按照文档中给出的说明进行操作。
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 {}
解决方案
只包括
<script src="ckeditor.com/apps/ckfinder/3.4.5/ckfinder.js"></script>
进入 index.html 文件,它会工作!
推荐阅读
- java - 记录来自 apache httpClient 的响应
- ios - 如何在导航栏的后退按钮中隐藏后退箭头?
- elasticsearch - 如何定期更新 ElasticSearch 索引?更新还是重建?
- python - python中“If”/“else”语句的问题
- java - 如何从一台设备触发多台设备的相同事件
- c# - eShopOnWeb 项目中的聚合是什么意思?
- javascript - 如何修复搜索框错误 ini 谷歌地图
- python - 将 PySpark DataFrame 中的每一行转换为 s3 中的文件
- ns-3 - 如何获取 NS-3 中每个数据包的接收时间?(802.11n+MIMO 示例)
- html - 如何在单独的div部分中设置复选框和标签的样式