销售文案
$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
创作工场
免责声明:
以上内容除特别注明外均来源于网友提问,创作工场回答,未经许可,严谨转载。
点击这里>>使用🔥专业版,更聪明、更完整、更原创!