title: Multiple select in angularjs form
body: <p>I have a simple form which is used to edit an existing object (event) via REST API. If the id is passed as parameter my controller calls the service to pre-fill the form.</p>
  
  <p>This is the html code:</p>
  
  <pre><code>&lt;div class="jumbotron"&gt;
      &lt;div ng-controller="PersonListCtrl"&gt;
        &lt;form novalidate class="simple-form" ng-controller="EventController"&gt;
          Title*: &lt;input type="text" ng-model="event.title" /&gt;&lt;br /&gt;
          Subtitle: &lt;input type="text" ng-model="event.subtitle" /&gt;&lt;br /&gt;
          Speakers:
          &lt;select
              multiple ng-model="event.speakers"
              ng-multiple="true"
              ng-options="person.id as person.name for person in persons"&gt;
          &lt;/select&gt;&lt;br /&gt;
          &lt;input type="submit" ng-if="event.id" ng-click="update(event)" value="Save" /&gt;
          &lt;input type="submit" ng-if="!event.id" ng-click="create(event)" value="Create" /&gt;
        &lt;/form&gt;
  
        &lt;pre&gt;event: {{event | json}}&lt;/pre&gt;
        &lt;pre&gt;speakers: {{event.speakers | json}}&lt;/pre&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>And here is the controller:</p>
  
  <pre><code>jugtaasApp.controller('EventController', function($scope, $http, $routeParams) {
  
      $scope.event = {};
  
      $scope.update = function(event) {
          // TODO: update
      };
  
      $scope.create = function(event) {
          // TODO: create
      };
  
      if(!$routeParams.id) {
          return;
      }
  
      $http.get('services/events/' + $routeParams.id)
      .success(function(data) {
          $scope.event = angular.copy(data);
          $scope.event.speakers = [$scope.persons[0]];    
      });
  });
  </code></pre>
  
  <p>The <code>PersonListCtrl</code> calls another service to retrieve the list of available speakers.</p>
  
  <p>With this code services/events is correctly called and the fields (Title and Subtitle) are correctly filled, except the multiple select (speakers).</p>
  
  <p>The multiple select contains all the available person, but if the event has some speaker they are not selected as options.</p>
  
  <p>What should I do?</p>