Testing a new functionality where I can upload a JSON file to post data into a textarea. Additionally, I am able to manually input the JSON structure and transfer it to another textarea with removed whitespace and new lines successfully. However, encountering an issue when entering normal text and pressing enter, causing an unexpected token error.
Here is the JSON structure being used:
[
{
"id": 1,
"name": "Leanne Graham",
"username": "Bret",
"email": "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c596acaba6a0b7a085a4b5b7aca9eba7acbf">[email protected]</a>",
"address": {
"street": "Kulas Light",
"suite": "Apt. 556",
"city": "Gwenborough",
"zipcode": "92998-3874",
"geo": {
"lat": "-37.3159",
"lng": "81.1496"
}
},
"phone": "1-770-736-8031 x56442",
"website": "hildegard.org",
"company": {
"name": "Romaguera-Crona",
"catchPhrase": "Multi-layered client-server neural-net",
"bs": "harness real-time e-markets"
}
}
]
Find my Stack Blitz code here: https://stackblitz.com/edit/angular-zgyxet
If attempting to input plain text, an error occurs. How can I handle this error effectively and provide an alert to the user?