Commit ae535a6e authored by Bruno Martin's avatar Bruno Martin
Browse files

fix courses lists getting course Student

parent 546b7ad9
......@@ -5,9 +5,11 @@
app.controller('CourseListByPositionController', [
'$scope',
'Course',
'CourseStudent',
function (
$scope,
Course,
CourseStudent,
) {
function compare_by_position(a,b) {
......@@ -27,6 +29,16 @@
Course.query({}, function (courses) {
courses.sort(compare_by_position);
$scope.courses = courses;
CourseStudent.query({}, function (course_students){
$scope.course_students = course_students
angular.forEach($scope.courses, function(course) {
angular.forEach($scope.course_students, function(course_student) {
if (course.id === course_student.course.id) {
course.course_student = course_student;
}
});
});
});
});
}
]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment