I am trying to figure out if there is a way for either angular or just pure javascript to get the value of a textarea's row?
I have a project that I am working on with a fixed size textarea, once it reaches a certain number of characters, it needs to wrap to a new row (not necessarily a line break). In my project I need to post each row of text as if it was a new object to the server. So for example, if a person types a really long sentence, whatever word(s) exceeds the character limit needs to wrap into a new row. I then need to post the data back to the server as if each displayed row was a new object
This what I started to create, but realized it would not work for my needs, as a long sentence or paragraph may not have a line break, and each row is not exactly the same length in characters because a long word could wrap into a new row
Test(textarea) {
console.log(textarea)
let data = [];
console.log(this.test)
data = this.test.split('\n');
data.forEach(element = > {
var item = {
text: element
}
console.log(item)
});
}