Here's a simple example of what I'm trying to put into an angular app. I have a textarea whose text will be output to another part of the page, and if newlines are made in the textarea, I'd like those to transfer over as well. I've tried the answer given here, but that case wasn't using angular and it doesn't seem to be working for me (I tried it by using {{sometext.replace(/\n/g, "<br />")}}
but that just breaks the expression and just displays the expression as a string with curly braces and all. How can I fix this?
var app = angular.module('SomeApp', []);
app.controller('SomeController', function($scope){
$scope.sometext = "Some text\nMore text";
});
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<body ng-app='SomeApp'>
<div ng-controller='SomeController'>
<textarea ng-model='sometext' rows='8' cols='25'></textarea>
<p>{{sometext}}</p>
</div>
</body>