import * as coursesMockData from './courses.api-mock.json';
import { CourseModel } from './course/course.model';

export class CoursesService {
  private coursesList: CourseModel[];

  constructor() {
    this.coursesList = coursesMockData;
    console.log('CoursesService: constructor() this.coursesList', this.coursesList);
  }

  public getCourses() {
    // imitate async
    return new Promise((resolve, reject) => {
      setTimeout(() => resolve(this.coursesList), 1000);
    });
  }
}

import * as coursesMockData from './courses.api-mock.json';
import { CourseModel } from './course/course.model';

export class CoursesService {
  private coursesList: CourseModel[];

  constructor() {
    this.coursesList = coursesMockData;
    console.log('CoursesService: constructor() this.coursesList', this.coursesList);
  }

  // TODO: shouldn't this be inferred from the -- private coursesList: CourseModel[] --- ???
  public getCourses(): Promise<CourseModel[]> {
    // imitate async
    return new Promise((resolve, reject) => {
      setTimeout(() => resolve(this.coursesList), 1000);
    });
  }
}

Fix typings problem of the [at-loader]:
Fix typings problem of the [at-loader]:

[at-loader] Checking finished with 2 errors
[at-loader] src\app-artem\courses\courses.component.ts:17:9
    TS2322: Type '{}' is not assignable to type 'CourseModel[]'.

[at-loader] src\app-artem\courses\courses.component.ts:17:9
    TS2322: Type '{}' is not assignable to type 'CourseModel[]'.
  Property 'find' is missing in type '{}'.
