我想把一個ng模型作爲一個鍵並試圖檢索,但是當它的一個對象沒有工作,但當ng-model是字符串時工作。localStorage持久化鍵作爲對象嗎?
<!DOCTYPE html>
<html>
<head>
<script data-require="[email protected]" data- semver="1.5.7" src="https://code.angularjs.org/1.5.7/angular.js"></script>
<link rel="stylesheet" href="style.css" />
<script src="script.js"></script>
</head>
<body>
<div ng-app="myApp">
<input type="text" ng- model="someText.something.firstName" persist="" />
</div>
</body>
</html>
Plunkr這裏: http://plnkr.co/edit/QQAxrOjsRzpK6u81J95J?p=preview