换行'\ n'在带有aslo的Typescript中不起作用?

问题描述 投票:0回答:1

换行'\ n'''在打字稿中不起作用

我的示例打字稿代码为

 this.custPartyAddress =  estimation.partyName + ',' + '\n' +
 estimation.partyAddress + ',' + estimation.partyLandMark + ',' + estimation.partyCity + '\n' +
 estimation.stateName + ', Pin :' + estimation.partyPostalCode + ',' + '\n' + 'India.';

显示出是]

Raju, Sr Nagar,Near Teample,HYDERABAD Andhra Pradesh, Pin :500032, India.

如果上面用它代替像贝娄一样显示

 Raju<br/>, Sr Nagar<br/>,Near Teample<br/>,HYDERABAD Andhra Pradesh<br/>, Pin :500032, India.

html数据绑定

{{custPartyAddress}}

我尝试了很多方法都没有得到解决方案,请您给我建议解决方案...

换行'\ n'''在Typescript中不起作用,我的示例打字稿代码是this.custPartyAddress = Estimate.partyName +','+'\ n'+ estimate.partyAddress +','+ Estimate.partyLandMark +。 ..

html typescript bootstrap-4 newline
1个回答
0
投票

您需要使用innerHTML才能将其解释为代码

© www.soinside.com 2019 - 2024. All rights reserved.