原始问题:
销售文案
$scope.salesCopyList = [];
//获取销售文案
$scope.getSalesCopyList = function () {
var url = '/custom-sbd-web/product/getProductCopywriting.do';
var data = {
productId: $stateParams.productId
};
$http({url: url, method: 'post',data: data}).success(function (result) {
if (result.status == 'OK'&&result.results) {
//处理销售文案列表数据格式为array格式,方便ng-repeat遍历出来数据,并且保存到$scope中,用于页面显示。
angular.forEach(result.results, function (item) {
//处理回车符号,将回车符号替换为<br/>标签,以便在html中正常显示回车效果。
item.copywritingContent=item.copywritingContent?item.copywritingContent:'无';//如果内容为null或者undefined时,将其赋值为‘无’;
item["copywritingTitle"]=item["copywritingTitle"]?item["copywritingTitle"]:'无';//如果内容为null或者undefined时,将其赋值为‘无’;
item['copywritingContent']=item['copywritingContent'].replace(/ |\r
/g,"<br/>");//处理回车符号的问题。
$scope.salesCopyList[$scope
Prev:衡量大学生的学术成就应该用比考试更好的方法,写一篇英文议论文300-400字