Struggling to retrieve an array from my TypeScript function in Angular.
I've experimented with various methods, such as creating a public variable within the class to store courses and using 'return' before 'courses' in the function call, but I haven't had success. It should be a straightforward task, yet I can't seem to make it work.
getFallCourses(){
let fallCourses : xCourse[];
this.dataService.getFallCourses().subscribe((courses: xCourse[]) => {
fallCourses = courses;
});
return fallCourses;
}