Welcome to the Angular feedback portal. We’re happy you’re here! If you have feedback on how to improve the Angular, we’d love to hear it!

  • Check out the features or bugs others have reported and vote on your favorites. Feedback will be prioritized based on popularity.
  • If you have feedback that’s not listed yet, submit your own.

Thanks for joining our community and helping improve Syncfusion products!

1
Vote

Hello,

I am having the next error when I try to use the sample given in https://ej2.syncfusion.com/angular/documentation/rich-text-editor/getting-started/?no-cache=1


ERROR TypeError: str.match is not a function

    at evalExp (template.js:65)

    at compile (template.js:52)

    at Object.push../node_modules/@syncfusion/ej2-richtexteditor/node_modules/@syncfusion/ej2-base/src/template-engine.js.Engine.compile (template-engine.js:57)

    at compile (template-engine.js:16)

    at RichTextEditorComponent.push../node_modules/@syncfusion/ej2-richtexteditor/src/rich-text-editor/base/rich-text-editor.js.RichTextEditor.setValue (rich-text-editor.js:945)

    at RichTextEditorComponent.push../node_modules/@syncfusion/ej2-richtexteditor/src/rich-text-editor/base/rich-text-editor.js.RichTextEditor.setContainer (rich-text-editor.js:164)

    at RichTextEditorComponent.push../node_modules/@syncfusion/ej2-richtexteditor/src/rich-text-editor/base/rich-text-editor.js.RichTextEditor.preRender (rich-text-editor.js:157)

    at RichTextEditorComponent.push../node_modules/@syncfusion/ej2-richtexteditor/node_modules/@syncfusion/ej2-base/src/component.js.Component.appendTo (component.js:127)

    at RichTextEditorComponent.push../node_modules/@syncfusion/ej2-angular-richtexteditor/node_modules/@syncfusion/ej2-angular-base/src/form-base.js.FormBase.ngAfterViewInit (form-base.js:54)

    at callProviderLifecycles (core.js:22416)


this is the template:

<ejs-richtexteditor id='defaultRTE' height="80" [toolbarSettings]='tools' [iframeSettings]='iframe'>
<ng-template #valueTemplate>
<div>AAA</div>
</ng-template>
</ejs-richtexteditor>


this is the component

import { Component, OnInit, Input } from '@angular/core';
import { ToolbarService, LinkService, ImageService, HtmlEditorService,
} from '@syncfusion/ej2-angular-richtexteditor';
import { FormGroup, FormBuilder } from '@angular/forms';
import { rteTools } from '@ehr-common/shared/dictionaries/constants';
import _ from 'lodash';

@Component({
selector: 'app-custom-rte',
templateUrl: './custom-rte.component.html',
styleUrls: [
'./custom-rte.component.scss',
],
providers: [ToolbarService, LinkService, ImageService, HtmlEditorService]
})
export class CustomRteComponent implements OnInit {
form: FormGroup;
parentForm: FormGroup;
tools = rteTools;
public iframe: object = { enable: true };

@Input() set setParentForm (parentForm: FormGroup) {
this.parentForm = parentForm;
this.initForm();
if (_.get(this.parentForm, 'addControl')) {
this.parentForm.addControl('rte', this.form);
}
}

constructor(private fb: FormBuilder) { }

ngOnInit() {}

initForm() {
this.form = this.fb.group({
color: [],
font: [],
});
}

}


dependencies: ...
"@syncfusion/ej2-angular-navigations": "^16.4.54",
"@syncfusion/ej2-angular-pdfviewer": "^17.1.44",
"@syncfusion/ej2-angular-popups": "^17.1.40",
"@syncfusion/ej2-angular-richtexteditor": "^17.1.48",
"@syncfusion/ej2-angular-splitbuttons": "^16.4.53",


and the custom module imported

mport { RichTextEditorAllModule, RichTextEditorModule } from'@syncfusion/ej2-angular-richtexteditor';

@NgModule({
imports: [
RichTextEditorModule,
RichTextEditorAllModule,
],
export: [
RichTextEditorModule,
RichTextEditorAllModule,
],


The error happen on the execution of the line 945 of rich-text-editor.js

 var compiledString = void 0;

                compiledString = compile(this.valueTemplate);

                var compiledTemplate = compiledString({});