json - Angularjs : How to remove '\r\n' in my output -


why , how angular add \r\n @ end of text ? there's way remove them ? also, have other fields text \r\n not there !!. example of json output :

{ description : "description of country usa \r\n" id : 12 name : "usa\r\n" continent : "north of america" } 

as can see, continent text don't \r\n @ end.

create angular filter nocarriagereturn remove \r\n below on bind- jsfiddle reference - demo

sampleapp.filter('nocarriagereturn', function() {   return function(value) {     return (!value) ? '' : value.replace(/(\r\n|\n|\r)/gm, "");   }; }); 

hope helps!


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -