I'm trying to have a new line displayed in a string in my template. For some reason the new line is ignored. <br/> is not working, neither does \n.
Here is my function:
this.errorsString = '';
this.validateData();
for ( var i = 0; i < this.errors.length; i++){
this.errorsString += `${this.errors[i]}` +'<br/>'
console.log(this.errors[i])
}
html:
<div *ngIf="errorsString" >
<div class="redError">
{{ errorsString }}
</div>
</div>
this.errorsString +=`${this.error[i]}\n`orthis.errorsString += this.errors+''+'\n'