How can I replace my binding data’s < br > with line break?
like: passing data:
Hello< br >welcome to this group< br >type your text
and viewing data will be :
Hello
welcome to this group
type your text
to replace < br > with line break, I have used [innerHTML] like, <p [innerHTML]="a.Details">
; but here problem is, all letter are come as Capital formate.
Is there any alter form?
3
Answers
You can use different div.
eg.
You can use this way to update your code :
and your JS function
You could split the text from
<br>
and will have an array of each line.on the HTML side you can loop through the lines and use
<p *ngFor=let line of text>{{line}}</P>
to display them..ts file
.html file