[英]Kendo UI Angular2/4 rich text editor
誰能提供有關如何在Angular4應用程序中集成jQuery組件KendoEditor的指針? 我已經集成了jQuery組件Splitter控件,但不確定什么是集成KendoEditor的最佳方法。 不幸的是,與早期版本的KendoUI控件(用於〜AngularJS)相比,並非所有組件都存在於Kendo Angular UI工具的Angular2 / 4套件中。
任何指針都會有所幫助。 到目前為止,我已經嘗試使用類似
textarea #questionEditor name = "questionEditor" rows="10" cols="30"
,然后在打字稿中使用@View
來獲取此編輯器的引用。 它似乎失敗並給出如下錯誤:
無法讀取未定義的屬性“ nativeElement”
另外,我嘗試了使用div
-tags的類似方法,但到目前為止沒有結果。
面臨此問題的任何人-在嘗試從Kendo Angular World嘗試RTF文本或Window 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
}});
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.