Hi Vishnu,
I cleaned the code a bit up so I could actually understand it a bit better,
If you use this instead of what you have, what is put out on the console?
StudentService.getStudentDetails({ "status": $scope.status })
.then(function (response) {
$scope.rowCollection = response; // side effect, take care
return response.map(function (student) { return student.regNo })
})
.then(function (regNoColletion) { return StudentService.
getReasonsForStudentStatus({ 'regnNos': regNoCollection }) })
.then(function (reasonsResponse) {
if (!reasonsResponse.errors) {
$scope.StudentResonsCollection = reasonsResponse;
} else {
var errors = reasonsResponse.errors instanceof Array ?
reasonsResponse.errors : [reasonsResponse.errors];
NotificationService.showMessage('Vehicle Status', errors,
'error');
}
})
.catch(function (err) { console.error(err) })
.finally(function done() {
console.log('all done', $scope.rowCollection, $scope.
StudentResonsCollection)
})
Regards
Sander
--
You received this message because you are subscribed to the Google Groups
"Angular" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.