I am currently working on customizing the CKEditor by adding a new button using the ng2-ckeditor plugin. The CKEditor is functioning properly, but I have a specific requirement to implement a button that will insert a Rails template tag when clicked.
For example:
I can include the button as shown below, however, I am unsure about how to write the method that will insert the <%= sender_name %>
tag at the current text position in the CKEditor.
<ckeditor
[(ngModel)]="ckeditorContent">
<ckbutton [name]="'saveButton'"
[command]="'saveCmd'"
(click)="save($event)"
[icon]="'save.png'"
[label]="'Save Document'"
[toolbar]="'clipboard,1'">
</ckbutton>
</ckeditor>
Any assistance on how to achieve this functionality in Angular 2 TypeScript would be greatly appreciated.