Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
141129 | Nov 26,2018 09:41 AM UTC | Nov 27,2018 09:00 AM UTC | Angular - EJ 2 | 1 |
![]() |
Tags: RichTextEditor |
<div class="control-section">
<ejs-richtexteditor id='defaultRTE' #toolsRTE id='alltoolRTE' [toolbarSettings]='tools' (actionComplete)="onComplete($event)">
</ejs-richtexteditor>
</div> |
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)
}
}
}
} |
<script async src="https://cdn.embedly.com/widgets/platform.js" charset="UTF-8"></script> |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.