当前页面是一个list,点击某一条数据,跳转到另一个页面查看这条数据的详细内容。问题是:在当前页面可以获取到数据,不知为啥跳转到另一个页面后就没有获取到数据?
list页面
![]()
{{product.name}}
型号:{{product.price}} 颜色:{{item.color}}
详情
list事件:
$scope.itemdetail = function(id){
// alert(id)
$state.go('itemdetailpage', {id: id});
$scope.detailsss = [];
//发送字段
var detailoption = {'uid':1,'id':id}
//
var json ={
"service":"服务路径",
"reqData":detailoption
};
//post
$http({
method : 'POST',
url : posturl,
data: json,
header:headers
}).success(function(data) {
$scope.detailsss = data.respData;
}).error(function(data){
console.log(data.msg);
})
}
另一个页面-详情页:
{{d}}
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
把接收数据的数组的$scope改成了$rootScope
你没有向详情页传递具体数据啊,只传了id,
根据获取数据的代码不应该是写在详情页的吗
列表页做跳转就好啦