Using Angular.js and *ngFor to loop over an array and display the values. The goal is to preserve the spaces of elements in the array:
string arr1 = [" Welcome Angular ", "Line1", "Line2", "
Done "]
The current code snippet being used is:
<div *ngFor="let arrValue of arr1">
{{arrValue}}
</div>
Current output:
Welcome Angular
Line1
Line2
Done
Expected output:
Welcome Angular
Line1
Line2
Done
How can the spaces of elements in the array be preserved without any modification?
Here's a link to a stackblitz example demonstrating the issue. Any insights on how to achieve the desired outcome would be greatly appreciated.
Thank you!
https://stackblitz.com/edit/ngfor-examples?file=app%2Fapp.component.ts,app%2Fapp.component.css