我像这样发送我的数据
love.graphics.scale(math.floor(0.3*2048)/2048)
obj和$cookies.putObject("currentLocation,values,allLocList", obj, vm.tempData, vm.allLocationList);
为vm.tempData
。但是objects
是包含JSON对象的数组。
在我的状态文件中,我使用
获取数据vm.allLocationList
然后当我去控制器时, resolve: {
entity: function($cookies) {
return {
location: $cookies.getObject("currentLocation"),
values: $cookies.getObject("values"),
allLocationList: $cookies.getObject("allLocList")
};
}
}
是okey,entity.location
是okey但entity.values
未定义。你有什么想法吗?
答案 0 :(得分:1)
应该是$cookies.putObject(key, value, [options]);
- $cookies documentation:
$cookies.putObject("currentLocation",obj);
$cookies.putObject("values", vm.tempData);
$cookies.putObject("allLocList", vm.allLocationLis);
resolve: {
entity: function($cookies) {
return {
location: $cookies.getObject("currentLocation"),
values: $cookies.getObject("values"),
allLocationList: $cookies.getObject("allLocList")
};
}
}
<强>&GT; Demo fiddle 强>