0
我希望使用ngStorage存儲一個數組以滿足持久性數據需求。這裏是我的代碼:在ngStorage中存儲數組
.factory("items", function() {
var items = {};
items.data = [];
return items;
})
.controller('ItemsController', function($scope,items) {
$scope.items = items;
$scope.addItem = function (id,item,size,price,quantity) {
items.data.push({id,item,size,price,quantity});
}
})
我需要的物品數組存儲在ngStorage
請閱讀文檔https://github.com/gsklee/ngStorage –
你嘗試使用ngStorage了嗎?你的問題到底是什麼? –