我使用的是使用’
JQuery‘的Angular 4’
FroalaEditor‘.
我在solution之后找到了
import { Component,OnInit,ViewEncapsulation } from '@angular/core'; import * as $from 'jquery'; @Component({ selector: 'app-froala-editor',templateUrl: './froala-editor.component.html',styleUrls: ['./froala-editor.component.scss'],encapsulation: ViewEncapsulation.None }) export class FroalaEditorComponent implements OnInit { options; constructor() { } ngOnInit(){ $.FroalaEditor.DefineIcon('alert',{NAME: 'info'}); $.FroalaEditor.RegisterCommand('alert',{ title: 'Hello',focus: false,undo: false,refreshAfterCallback: false,callback: function () { alert('Hello!'); } }); this.options={ toolbarButtons: ['bold','italic','underline','paragraphFormat','alert','|','insertLink','insertImage','specialCharacters','color','align','formatOL','formatUL','undo','redo','clearFormatting','print'],} } }
但我有以下错误.
Property ‘FroalaEditor’ does not exist on type ‘JQueryStatic’.
我发现这是solution,但我不确定如何实现它.
有人遇到过这个问题吗?