是否有可能在角带警报或html中显示错误列表(逗号分隔数组)?
我没有办法做到这一点。
$scope.errors = response.split(',');
var myAlert = $alert({
title: 'title',
content: '-----------',
placement: 'top',
type: 'success',
duration: '1',
show: true
});
答案 0 :(得分:1)
由于该数组是用逗号分隔的字符串创建的...只需传入原始字符串
var myAlert = $alert({
title: 'title',
content: response,
placement: 'top',
type: 'success',
duration: '1',
show: true
});
或者使用$scope.errors.join(', ');