Rohit luthra
2016-05-17 12:30:51 UTC
How to use lodash or any alternative to angular.foreach
var data = {
TimeStamp : "2016-04-25 12:50:00"
};
$http({
method: 'POST',
url: $location.protocol()+ '://' + $location.host() + ':' +
$location.port() + '/serverutilizationreport',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
data: $httpParamSerializerJQLike(data),
}).success(function(data) {
$scope.pieData = [];
$scope.chartData = [];
$scope.requesttypes = [];
$scope.uniqrequesttypes = [];
$scope.transactionResponseTimeArray = [];
$scope.transactionCountArray = [];
$scope.totalRendererFailedTransactions;
$scope.totalRendererCompletions;
//$scope.requestcount = [];
*angular.forEach(data, function(record) {*
var rendererOutTime = record.RendererOutTime;
var rendererInTime = record.RendererInTime;
var requestURI = record.RequestURI;
var timeTakenMS = record.TimeTakenMS;
var errorMessage = record.ErrorMessage;
if(errorMessage && rendererOutTime && rendererInTime){
$scope.totalRendererFailedTransactions++;
}
if(rendererOutTime && rendererInTime){
$scope.totalRendererCompletions++;
}
if(requestURI && rendererOutTime && rendererInTime){
$scope.transactionResponseTimeArray.push(timeTakenMS);
$scope.transactionCountArray.push($scope.transactionResponseTimeArray.length)
nameSpace = requestURI.substring(1);
if(nameSpace.indexOf('/') != -1){
nameSpace= nameSpace.substring(0, nameSpace.indexOf('/'));
}
else if(nameSpace.indexOf('?') != -1){
nameSpace= nameSpace.substring(0, nameSpace.indexOf('?'));
}
else{
nameSpace= nameSpace.substring(0, nameSpace.length);
}
if(nameSpace){
if($scope.uniqrequesttypes.indexOf(nameSpace) == -1){
$scope.uniqrequesttypes.push(nameSpace);
}
$scope.requesttypes.push(nameSpace);
}
}
});
var data = {
TimeStamp : "2016-04-25 12:50:00"
};
$http({
method: 'POST',
url: $location.protocol()+ '://' + $location.host() + ':' +
$location.port() + '/serverutilizationreport',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
data: $httpParamSerializerJQLike(data),
}).success(function(data) {
$scope.pieData = [];
$scope.chartData = [];
$scope.requesttypes = [];
$scope.uniqrequesttypes = [];
$scope.transactionResponseTimeArray = [];
$scope.transactionCountArray = [];
$scope.totalRendererFailedTransactions;
$scope.totalRendererCompletions;
//$scope.requestcount = [];
*angular.forEach(data, function(record) {*
var rendererOutTime = record.RendererOutTime;
var rendererInTime = record.RendererInTime;
var requestURI = record.RequestURI;
var timeTakenMS = record.TimeTakenMS;
var errorMessage = record.ErrorMessage;
if(errorMessage && rendererOutTime && rendererInTime){
$scope.totalRendererFailedTransactions++;
}
if(rendererOutTime && rendererInTime){
$scope.totalRendererCompletions++;
}
if(requestURI && rendererOutTime && rendererInTime){
$scope.transactionResponseTimeArray.push(timeTakenMS);
$scope.transactionCountArray.push($scope.transactionResponseTimeArray.length)
nameSpace = requestURI.substring(1);
if(nameSpace.indexOf('/') != -1){
nameSpace= nameSpace.substring(0, nameSpace.indexOf('/'));
}
else if(nameSpace.indexOf('?') != -1){
nameSpace= nameSpace.substring(0, nameSpace.indexOf('?'));
}
else{
nameSpace= nameSpace.substring(0, nameSpace.length);
}
if(nameSpace){
if($scope.uniqrequesttypes.indexOf(nameSpace) == -1){
$scope.uniqrequesttypes.push(nameSpace);
}
$scope.requesttypes.push(nameSpace);
}
}
});
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.