在名为的控制器下,usersConrtoller.js
我将一些对象数据存储在localStorage
using 中ngStorage
。
$scope.users = [{
"entity$": "-/sys/daily_journeys",
"name": "Tom",
"walked": 90,
"traveled_distance": "773",
"total_cout": 0.367,
"days": 22,
"avg_risk": "0.0",
"risk_category": "GREEN"
}]
保存到本地存储:
$localStorage.users = $scope.users;
如何$localStorage.users
在其他控制器中访问对象的数据?