Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/365.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在AnguarJs中打印swal警报框中的数组?_Javascript_Angularjs - Fatal编程技术网

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)