I have four service call functions for dropdown binding in a screen, am using angularjs
http
call for get data from WEB API
service.
below are the methods
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');
}
})
}
I have call the above functions in one by one.
loadUserList();
loadProjects();
loadStatus();
loadTasks();
Html : I have binding the four dropdown by this way
<select style="width: 160px" ng-model="SelectedTask" class="form-control" name="SelectedTask"
ng-options="tasklist.TaskName for tasklist in TaskList">
</select>
This first two functions are very slow for get some data from WEBAPI
, my database have just 5 rows only. but very slow. but i am using same functions in another screen, that's working very good.
also i got this error message whenever the loadStatus();
(third function) function is calling.
The error message is : JavaScript runtime error: Not enough storage is available to complete this operation. in angularjs
And also i will show the performance details when i run some other screens vs the problem detected screen.
See the CPU
usage. I can't find out the solution. Please help me.
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