gpt4 book ai didi

javascript - 如何在 Javascript 中的消息正文中添加按钮?

转载 作者:太空宇宙 更新时间:2023-11-04 06:03:25 25 4
gpt4 key购买 nike

我试过像下面这样构造消息正文-

我收到对象对象异常,如果我保留在消息正文中,它对我不起作用-

      "Dear " +
$scope.emailContactinfo.name +
", \n\nPlease find attached Invoice bearing number " +
$scope.invoiceInformation.documentNo +"Paynow\n\n" +$scope.generatedUrl +
" dated " +
moment($scope.invoiceInformation.invoiceDate).format("MM-DD-YYYY") +
". \n\nThanks and Regards,\n" +
$scope.invoiceInformation.organization$_identifier +
"." + button ;`

最佳答案

我建议使用这种格式,这样代码更具可读性——

 const button = '<button>Button</button>';
`Dear ${$scope.emailContactinfo.name}, \n\nPlease find attached Invoice bearing number ${$scope.invoiceInformation.documentNo} Paynow\n\n ${$scope.generatedUrl} dated ${ moment($scope.invoiceInformation.invoiceDate).format("MM-DD-YYYY")}. \n\nThanks and Regards,\n ${$scope.invoiceInformation.organization$_identifier}. ${button}`

关于javascript - 如何在 Javascript 中的消息正文中添加按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57091734/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com