1
votes

I'm using TinyMCE editor component in my Angular 7 app. When i insert a template variable into the editor:

<span class="data-variable">${variable_name}</span>

It gets replaced fine with a value from my template_replace_values object i initialize tinymce with:

let template_replace_values = {variable_name: "hello world!"}

Ouput:

<span class="data-variable">hello world!</span>

However when i save this, it would save the static value and not the template variable as i expected like below:

<span class="data-variable">${variable_name}</span>

I thought this transformation was built in both ways but i find the documentation unclear, and would hate to craft something myself if it is already built in and i'm missing something.

1

1 Answers

1
votes

This is not how that plugin is designed to work. The replacement is a one time task at the point that it is inserted. If you wanted different behavior you would have to modify that plugin to meet your needs.