import { Component ,ViewChild} from '@angular/core';
import { ToolbarService, LinkService, ImageService, HtmlEditorService,RichTextEditorComponent } from '@syncfusion/ej2-angular-richtexteditor';
@Component({
selector: 'control-content',
templateUrl: 'rich-text-editor.html',
})
export class DefaultRTEComponent {
@ViewChild('toolsRTE') public rteObj: RichTextEditorComponent;
public tools: object = {
items: ['Bold', 'Italic', 'Underline', 'StrikeThrough',
'|', 'CreateLink' ]
};
onComplete(args)
{
if (args.requestType === 'Links') {
if (args.elements[0].parentNode && args.elements[0].parentNode.tagName === 'A') {
let emberEle=document.createElement('blockquote')
emberEle.setAttribute('class', 'embedly-card')
emberEle.appendChild(args.elements[0].parentElement);
emberEle.appendChild(document.createElement('p'))
args.range.insertNode(emberEle)
}
}
}
} |