So I'm trying to do something very simple and I'm stuck. I have a String
variable and within that variable I Wanna set line break so certain part of the text goes to new line.
What I have tried:
title: string = "My \n Title";
title: string = "My\ Title";
title: string = "My\
Title";
title: string = "My" + "\n" + "Title";
I have tried many variations but its just not working. Am I being stupid and missing something very obvious?
Not a duplicate as I have tried the <br/>
and it has not worked.
Update:
The variable is being printed in the browser HTML like so {{title}}
. May be you embed your
as string and not as JSX ? – Mosè Raguzzini Dec 06 '17 at 15:58