<li ng-repeat='msg in msgs'>{{msg}}</li>
msgs=['abc','a
b
v', '123']
msgs.push('Something entered from textarea, possibly containing line breaks')
- abc
- a
b
v- 123
- abc
- a b v
- 123
attempted to refactor < li> label to <myli>
app.directive('myli', function ($rootScope) {
return {
restrict: 'E',
replace: true,
template: "<li></li>",
link: function(scope, element, attr) {
element.append(scope.msg);
}
}
});
However, this did not produce the desired result, as it only altered the initial data.
When appending something to msgs that contains line breaks, the line breaks are converted to spaces.
Seeking assistance