Friday, 30 November 2018

angular 6 pipe how to add multi empty spaces


if you want to add spaces in pipe, you will found that.

1.     doesn't work,
2. if put " " an empty space , it works, but multi spaces will collapse into 1 space.

to fix that you need to :


<div style="white-space: pre">{{text | yourpiple}}</div>


https://www.w3schools.com/cssref/pr_text_white-space.asp

No comments:

Post a comment