title: Automatically return data after selecting an item in AngularJS
body: <p>For school I'm making an exercise.</p>
  
  <p>The exercise is as follows.
  When a school subject is selected it must automatically return the teacher of school subject.
  It is required to make use of a controller.</p>
  
  <p>Now I tried to make it , and thought to have the solution, but unfortunately it does not work and I have no idea why.</p>
  
  <p>Does anyone see where it goes wrong ?</p>
  
  <pre><code> &lt;div ng-app="subjectApp"&gt;
      &lt;div ng-controller="teacherController"&gt;
          Choose a school subject:
          &lt;select name="repeatSelect" id="repeatSelect" ng-model="data.repeatSelect"&gt;
              &lt;option ng-repeat="option in data.availableOptions" value="{{option.subject}}"&gt;{{option.subject}}&lt;/option&gt;
          &lt;/select&gt;
          &lt;br&gt;
          You have chosen, {{data.repeatSelect}} is given by {{data.teacher}}.
      &lt;/div&gt;
      &lt;hr&gt;
  &lt;/div&gt;
  &lt;script&gt;
      var subjectApp = angular.module("subjectApp", []);
      subjectApp.controller('teacherController', function ($scope) {
          $scope.data = {
              repeatSelect: null,
              availableOptions: [
                  {subject: "PEV", teacher: "a Teacher name1"},
                  {subject: "WH", teacher: "a Teacher name2"},
                  {subject: "APP", teacher: "a Teacher name3"},
                  {subject: "ASP", teacher: "a Teacher name4"},
                  {subject: "PHP", teacher: "a Teacher name5"},
                  {subject: "CSP-3", teacher: "a Teacher name6"},
                  {subject: "CISCO-P", teacher: "a Teacher name7"}
              ]
          };
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>Regards Jens</p>