我有四个用于屏幕中下拉菜单绑定(bind)的服务调用函数,我使用 angularjs
http
调用从 WEB API
服务获取数据。
下面是方法
function loadProjects() {
$http({
method: 'GET',
url: rootUrl + '/api/Project/ProjectList',
headers: {
'Content-Type': "application/json; charset=utf-8"
}
}).success(function (response) {
response.push({ ProjectName: "Select", ProjectId: 0 });
$scope.ProjectList = response;
$scope.SelectedProject = response[$scope.ProjectList.length - 1];
}).error(function (response, errorCode) {
if (errorCode == 444) {
//toastr.error('Your email address is does not verrified ', 'Error');
}
})
}
function loadTasks() {
$http({
method: 'GET',
url: rootUrl + '/api/Task/TaskList',
headers: {
'Content-Type': "application/json; charset=utf-8"
}
}).success(function (response) {
$scope.TaskList = response;
}).error(function (response, errorCode) {
if (errorCode == 444) {
//toastr.error('Your email address is does not verrified ', 'Error');
}
})
}
function loadStatus() {
$http({
method: 'GET',
url: rootUrl + '/api/Status/GetAllStatus',
headers: {
'Content-Type': "application/json; charset=utf-8"
}
}).success(function (response) {
response.push({ StatusTypeName: "Select", StatusTypeId: 0 });
$scope.StatusType = response;
$scope.SelectedStatusType = response[$scope.StatusType.length - 1];
}).error(function (response, errorCode) {
if (errorCode == 444) {
//toastr.error('Your email address is does not verrified ', 'Error');
}
})
}
function loadUserList() {
$http({
method: 'GET',
url: rootUrl + '/api/Account/ListOfUsers',
headers: {
'Content-Type': "application/json; charset=utf-8"
}
}).success(function (response) {
response.push({ FirstName: "Select", UserId: 0 });
$scope.UserList = response;
$scope.SelectedUser = response[$scope.UserList.length - 1];
}).error(function (response, errorCode) {
if (errorCode == 444) {
//toastr.error('Your email address is does not verrified ', 'Error');
}
})
}
我已经一一调用了上面的函数。
loadUserList();
loadProjects();
loadStatus();
loadTasks();
Html: 我通过这种方式绑定(bind)了四个下拉列表
<select style="width: 160px" ng-model="SelectedTask" class="form-control" name="SelectedTask"
ng-options="tasklist.TaskName for tasklist in TaskList">
</select>
前两个函数从 WEBAPI
获取一些数据非常慢,我的数据库只有 5 行。但很慢。但我在另一个屏幕上使用相同的功能,效果非常好。
每当 loadStatus();
(第三个函数) 函数调用时,我也会收到此错误消息。
错误消息是:JavaScript 运行时错误:没有足够的存储空间来完成此操作。在 AngularJS 中
当我运行其他一些屏幕与检测到问题的屏幕时,我还将显示性能详细信息。
查看CPU
使用情况。我找不到解决办法。请帮助我。
I also got some answers from google, but they said it is a visual studio problem. but I don't think this is vs problem. because other screens are working well. Please help me guys ;) Thanks in advance
最佳答案
通过进入 IE 的 Internet 选项 > 浏览历史记录设置 > 磁盘空间,我能够解决出现相同错误的问题。增加允许的磁盘空间,这可能会解决您的问题。
事实证明,IE 默认情况下只允许浏览器使用 250MB 磁盘空间。当然,这只是特定于一台机器的环境变化,但这在我的情况下有效(因为我们使用的数据> 250 MB)
关于AngularJS 中的 JavaScript 运行时错误 : Not enough storage is available to complete this operation.,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29845708/