1

please give a brief idea with example of how to add a custom html source code edit button in p-editor of primeng! As, it is not provided in default p-editor format. Please help me in this context.

Thanks in advance :)

1

1 Answer 1

1

If you load the content in "ngOnInit" or in the constructor, the editor won't fail. However if you want to load dynamically, I think that you must use a different var and then replace it

OR

Use this function before assign that var

escapeHtml(text) {
    if (!text) {
      text = '';
    }
    text += '';
    text = text
      .replace(/&/g, '&')
      .replace(/&lt;/g, '<')
      .replace(/&gt;/g, '>')
      .replace(/&quot;/g, '"')
      .replace(/&#039;/g, '\'');
    return text;
  }
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.