I have the following tag but '\n' inside item.value
not formatted correctly .
<td ng-if="flag">{{item.value}}</td>
I have the following tag but '\n' inside item.value
not formatted correctly .
<td ng-if="flag">{{item.value}}</td>
HTML needs a <br/>
tag. Use this regex on your value.
item.value = item.value.replace(/(?:\r\n|\r|\n)/g, '<br>');
let item = {};
item.value= "Hi I am some text with a \n line break";
item.value = item.value.replace(/(?:\r\n|\r|\n)/g, '<br>');
document.write(item.value);
{{ctrl.formatLine(item.value)}}