@@ -4,6 +4,7 @@ import { ActivatedRoute, Params } from '@angular/router';
44import { CommunicationService } from '../shared/communication.service' ;
55import { log } from 'util' ;
66import { UserService } from '../../../services/user.service' ;
7+ import { CoursesService } from '../shared/courses.service' ;
78
89@Component ( {
910 selector : 'courses' ,
@@ -23,6 +24,7 @@ export class CoursesComponent implements AfterViewInit {
2324 public userService : UserService ,
2425 private activatedRoute : ActivatedRoute ,
2526 public comService : CommunicationService ,
27+ public coursesService : CoursesService ,
2628 public renderer : Renderer2 ) { }
2729
2830 ngAfterViewInit ( ) {
@@ -42,10 +44,16 @@ export class CoursesComponent implements AfterViewInit {
4244
4345 requestCoursesByUser ( ) :void {
4446 this . userService . getCoursesByUser ( ) . subscribe ( response => {
45- this . courses = response ;
47+ response . forEach ( element => {
48+ this . courses = [ ] ;
49+ this . coursesService . getCoursesByCourseId ( element . ANM_KURS_ID ) . subscribe ( response => {
50+ console . log ( response ) ;
51+ response . ANM_DATUM = element . ANM_DATUM ;
52+ this . courses . push ( response ) ;
53+ } ) ;
54+ } ) ;
4655 if ( response . name != "HttpResponseError" ) {
4756 this . dataIsAvailable = true ;
48- this . courses = response ;
4957 }
5058 } ) ;
5159 }
0 commit comments