As a beginner in front-end development, I am exploring different approaches to handling a text area that inserts a new line after each comma. My main focus is on finding the best solution within AngularJs (filter, Regex, etc).
Before:
hello,how,are,you
After:
Hello
how
are
you
Current Setup:
<textarea cols="105" rows="30" disabled="true"
style="background-color: floralwhite; resize: none; white-space: normal; margin-top: 0px; border: none;">
{{profile.exampleValues}}
</textarea>
I attempted to create a filter but did not succeed:
.filter('newlines', function () {
return function (text) {
return text.replace(',', '<br/>');
}
})