Suppose you have a textarea editor and you entered some text in it and making some formatting like change font or adding style etc . So now you want that when you are showing it you don't want to shown html you adding in it. See screenshot below.
To do this below is a simple filter you can use :
You just need to be add this filter in your app.js and change the "yourAppName" with your own.
Method of calling this filter :To do this below is a simple filter you can use :
You just need to be add this filter in your app.js and change the "yourAppName" with your own.
yourAppName.filter('htmlToPlaintext', function() {
return function(text) {
return text ? String(text).replace(/<[^>]+>/gm, '') : '';
};
});
<label style="color: #636363;">{{company.notes | htmlToPlaintext}}</label>
If you like this post don't forgot to leave a comment.
Chears
Happy Coding :)