title: how to get all options of select using angularjs
body: <p>I need to get all options of a multiple select using angularjs, there are selected or not. The options are dynamic. No always the select have the same options.</p>
  
  <p>HtML:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code> &lt;div class="row"&gt;
              &lt;div class="form-group col-xs-5"&gt;
                  &lt;label&gt;Select 1&lt;/label&gt;
                  &lt;select multiple="multiple" class="form-control" id="origen" name="origen[]"&gt;
                      &lt;option&gt;A&lt;/option&gt;
                      &lt;option&gt;B&lt;/option&gt;
                      &lt;option&gt;C&lt;/option&gt;
                  &lt;/select&gt;
              &lt;/div&gt;
              &lt;div class="form-group col-xs-2 buttoms-left-right"&gt;
                  &lt;p&gt;
                      &lt;br /&gt;
                      &lt;button type="button" class="btn btn-default" id="goright"&gt;&lt;span class="glyphicon glyphicon-chevron-right"&gt;&lt;/span&gt;&lt;/button&gt;
                  &lt;/p&gt;
                  &lt;p&gt;
                      &lt;button type="button" class="btn btn-default" id="goleft"&gt;&lt;span class="glyphicon glyphicon-chevron-left"&gt;&lt;/span&gt;&lt;/button&gt;
                  &lt;/p&gt;
              &lt;/div&gt;
              &lt;div class="form-group col-xs-5"&gt;
                  &lt;label&gt;Select 2&lt;/label&gt;
                  &lt;select multiple="multiple" class="form-control" id="destino" name="destino[]" ng-model="formData.tags"&gt;&lt;/select&gt;
              &lt;/div&gt;
          &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I have e jquery that pass data from select 1 to select 2. I need all select 2 options, but using angularjs</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>jQuery(document).ready(function(){
      jQuery('#goright').click(function() { return !jQuery('#origen option:selected').remove().appendTo('#destino'); });
      jQuery('#goleft').click(function() { return !jQuery('#destino option:selected').remove().appendTo('#origen'); });
  
  });</code></pre>
  </div>
  </div>
  </p>
  
  <p>And in angularjs I have:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>angular.module('formDS', ['ngAnimate', 'ui.router'])
  
  // router configurations
  
  .controller('formDSController', function($scope, $http) {
    
          $scope.formData = {};
  
          $scope.processForm = function() {
              console.log($scope.formData.tags); //return undefined
          };
          
  // other code
  
      });</code></pre>
  </div>
  </div>
  </p>