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
Post a Comment