AngularJS Example
HTML
<div ng:app="myApp">
<div ng-controller="Ctrl">
<p>This is how it looks now when I retrieve the snippet list from the server</p>
<textarea cols="60" rows="3" name="fighterList" ng-init="fighterList">{{fighterList|newlines}}</textarea>
<br />
<br />
<p>This is how I am trying to make it look like, so I can resuse the objects.</p>
<div style="border:1px solid grey;width:50%">
<p>1<br />2<br />3<br /></p>
</div>
</div>
</div>
JavaScript
angular.module('myApp',[]).filter('newlines', function () {
return function(text) {
return text.join('\n');
}
})
function Ctrl($scope) {
$scope.fighterList = [1,2,3]
}