Javascript 如何在AnguarJs中打印swal警报框中的数组?
Javascript 如何在AnguarJs中打印swal警报框中的数组?,javascript,angularjs,Javascript,Angularjs,swal({ 标题:“HTML欢迎使用SWAL!”, text:“html格式{{$scope.productArray}}消息。”, html:对 });试试这个 swal({ title: "HTML <small>Welcome to SWAL</small>!", text: "A html format <span style='color:#F8BB86'> {{ productArra
swal({
标题:“HTML欢迎使用SWAL!”,
text:“html格式{{$scope.productArray}}消息。”,
html:对
});代码>试试这个
swal({
title: "HTML <small>Welcome to SWAL</small>!",
text: "A html format <span style='color:#F8BB86'>
{{ productArray }}<span> message.",
html: true
});
swal({
标题:“HTML欢迎使用SWAL!”,
文本:“html格式
{{productArray}}消息。“,
html:对
});
试试这个
swal({
title: "HTML <small>Welcome to SWAL</small>!",
text: "A html format <span style='color:#F8BB86'>
{{ productArray }}<span> message.",
html: true
});
swal({
标题:“HTML欢迎使用SWAL!”,
文本:“html格式
{{productArray}}消息。“,
html:对
});
据我所知,模板语法不适用于js字符串,但您可以使用标准js字符串连接:
swal({
title: "HTML <small>Welcome to SWAL</small>!",
text: "A html format <span style='color:#F8BB86'>" + $scope.productArray.toString() + "<span> message.",
html: true
});
swal({
标题:“HTML欢迎使用SWAL!”,
text:“html格式”+$scope.productArray.toString()+“消息。”,
html:对
});
据我所知,模板语法不适用于js字符串,但您可以使用标准js字符串连接:
swal({
title: "HTML <small>Welcome to SWAL</small>!",
text: "A html format <span style='color:#F8BB86'>" + $scope.productArray.toString() + "<span> message.",
html: true
});
swal({
标题:“HTML欢迎使用SWAL!”,
text:“html格式”+$scope.productArray.toString()+“消息。”,
html:对
});
它不工作,现在显示在警报中-显示html格式{productArray}消息相同的文本?它不工作,现在显示在警报中-显示html格式{productArray}消息相同的文本?它工作,但是在swal中它将显示[object object],[object object],而不是数组?您希望它如何显示?您可以尝试JSON.stringify($scope.productArray)
?它可以工作,先生,但是在swal中它将显示[object object],[object object],而不是数组?您希望它如何显示?您可以尝试JSON.stringify($scope.productArray)
?