HTML Injection in ion-input

Hello all, I develop a demo app where user can create a post by providing following inputs(ion-input type=“text”).

While testing some user will type some HTML scripting and the result you can see on attached image.

So my question is how can we prevent this type of inputs in ionic ?

The only way I’m aware of that Ionic apps will attempt to display user-generated HTML is if you bind innerHTML. So if you’re doing that, don’t do that. If this HTML is being submitted to an external website, then I would consider it the responsibility of the backend. It doesn’t make any sense to me to create an honor system for front-ends to protect a vulnerable backend, because blackhats don’t obey honor systems.