任何人都可以提供有关如何在 Angular4 应用程序中集成 jQuery 组件 KendoEditor 的指导吗? 我已经集成了 jQuery 组件 Splitter 控件,但不确定集成 KendoEditor 的最佳方式是什么。 不幸的是,与早期版本的 KendoUI 控件(针对 ~AngularJS)相比,并非所有组件都存在于 Kendo Angular UI 工具的 Angular2/4 套件中。
任何指示都会有帮助。 到目前为止,我已经尝试过使用类似的东西
textarea #questionEditor name = "questionEditor"rows="10"cols="30"
然后在 typescript 中使用@View
来获取该编辑器的引用。它似乎失败并给出类似错误 -
Cannot read property 'nativeElement' of undefined
此外,我使用 div
-tags 尝试了类似的方法,但到目前为止还没有结果。
编辑
遇到此问题的任何人 - 请确保在尝试 Kendo Angular World 中的富文本或窗口 JQuery 控件之前加载您的 Kendo 主题。
最佳答案
这可以帮助您检查
import {Component, OnInit, ViewChild, ElementRef, AfterViewInit} from '@angular/core';
declare var kendo: any;
@Component({
selector: 'app-text-editor',
templateUrl: './text-editor.component.html',
styleUrls: ['./text-editor.component.scss']
})
export class TextEditorComponent implements OnInit , AfterViewInit {
@ViewChild("questionEditor") questionEditor : ElementRef;
constructor() { }
ngOnInit() { }
ngAfterViewInit() {
kendo.jQuery(this.questionEditor.nativeElement).kendoEditor({ resizable: {
content: true,
toolbar: true
}});
}
}
关于jquery - Kendo UI Angular2/4 富文本编辑器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46737452/