I need to replace all _ from a string in my angular app. In my controller, following code gives correct result:
_
alert(\"this_is_string_\".replace(
Using angular filter is the best practice to filter from html.
Have a look at angular-filter here
.filter('customFilter', ['$filter', function ($filter) { return function (input) { if (input) { return input.replace(/_/g, ''); } } }])
{{ key | customFilter}}