How to get line break within string interpolation in Angularjs

前端 未结 5 1856
萌比男神i
萌比男神i 2021-01-05 10:15

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

5条回答
  •  耶瑟儿~
    2021-01-05 10:53

    You have done the right thing. But if you are showing this in a browser, the \n means didley.

    You have to do:

    title: string = "My
    Title"

    Now if you are using a fancy front end tool like React, you will have to deal with unsafe HTML in strings...

提交回复
热议问题