您好我写下了代码,其中我从$ scope.products
中的其他控制器获取价值我想在重新加载页面后存储此值
请帮助
app.controller("detailcntrl", function ($scope, $http, jsonService, $location, $localStorage) {
$scope.products = jsonService.getData();
$scope.products = $scope.products[$scope.products.length-1];
$localStorage.Count = $scope.products;
console.log($localStorage.Count);
$http.get('http://www.w3schools.com/angular/customers.php').
success(function(data, status, headers, config) {
$scope.posts = data.records;
$scope.posts = $scope.posts[$scope.products];
$scope.stat = status;
if($scope.posts == "" || $scope.posts == null){
$('#Loading').hide();
$('#Error').show();
}
else
{
$('#Loading, #Error').hide();
}
}).
error(function(data, status, headers, config) {
});
$scope.welcomePage = function(){
$location.path("/welcome");
};
});