【发布时间】:2014-08-20 06:17:35
【问题描述】:
我有返回 json 响应的 api,我想将该 json 响应存储在 localstorage 中,以便使用 angularjs 在我的另一个 html 页面中使用该响应。
这是我返回 json 响应的代码......
QAApp.controller('SearchCtrl', function ($scope, $http, $location) {
$scope.search = function (searchtag) {
var request = $http({
method: 'GET',
url: server + 'api/question/tagged/' + searchtag,
});
request.success(function(data, status, headers, config) {
console.log(data);
$scope.qa = data;
});
}
});
请告诉我如何存储它...
【问题讨论】: