title: How to compare your input data with the data received from a service , to check validity (Angular)
body: <p>I have an application where the students can manage their courses. The student has 2 views where he can either add the courses individually or another view where he can see the list of courses and he can add multiple courses together or disable courses from the list which are not relevant.
  When the user disables courses it is stored in an array called not applicable courses.</p>
  
  <p>Now I want to alert the user in the 'add course individually view' when he tries to add courses which he has disabled</p>
  
  <p>When I load the form I have a service which contains data about these disabled courses in an array. How do I compare the users the input with the courses in this array that is returned by the service?</p>
  
  <pre><code>private initCourses() {
    this.courseAccessService.gettopicById(this.courseId).subscribe(
      (topicDto: TopicDto) =&gt; {
        this.course = topicDto
  
      },
      err =&gt; {
        this.displayError = true
      }
    )
  }
  </code></pre>
  
  <p>This is the service that holds the disabled course list</p>