2

任何人都可以提供有关如何在 Angular4 应用程序中集成 jQuery 组件KendoEditor的指针吗?我已经集成了 jQuery 组件Splitter控件,但不确定集成 KendoEditor 的最佳方式是什么。不幸的是,与早期版本的 KendoUI 控件(用于 ~AngularJS)相比,并非所有组件都存在于 Angular2/4 的 Kendo Angular UI 工具套件中。

任何指针都会有所帮助。到目前为止,我已经尝试使用类似的东西

textarea #questionEditor name = "questionEditor" rows="10" cols="30" 然后@View在打字稿中使用以获取此编辑器的参考。它似乎失败并给出错误,例如 -

无法读取未定义的属性“nativeElement”

另外,我尝试了使用div-tags 的类似方法,但直到现在还没有结果。

编辑

遇到此问题的任何人 -在尝试来自 Kendo Angular World 的富文本或 Window JQuery 控件之前,请确保已加载您的 Kendo主题。

4

1 回答 1

0

这可能会帮助您检查它

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
     }});
  }
}
于 2017-10-29T22:55:33.137 回答