我正在尝试执行存储应用程序设置的JSON数组。
我无法改变这些值,我不知道该怎么做
Services.js:
foreach (DataColumn column in table.Columns)
{
columns.Add(column.ColumnName);
DocumentFormat.OpenXml.Spreadsheet.Cell cell = new DocumentFormat.OpenXml.Spreadsheet.Cell();
cell.DataType = DocumentFormat.OpenXml.Spreadsheet.CellValues.String;
cell.CellValue = new DocumentFormat.OpenXml.Spreadsheet.CellValue(column.ColumnName);
headerRow.AppendChild(cell);
}
controllers.js
$localStorage = $localStorage.$default({
settingsArray : [{"autoDelete" :false},{"deleteDate" : 0}]
});
var _changeDelDate = function(num){
$localStorage.settingsArray.deleteDate = num;
};
settings.html
SettingsArray = StorageService.returnSettingsArray();
$scope.range = SettingsArray[1];
$scope.slider = function(num){
StorageService.changeDelDate(num);
}
答案 0 :(得分:0)
那是因为你没有改变数组值
您正在更改阵列上的属性
应该是:$localStorage.settingsArray[1].deleteDate = num;