Reputation: 11
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 :)
Upvotes: 1
Views: 1695
Reputation: 41
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(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"')
.replace(/'/g, '\'');
return text;
}
Upvotes: 1