title: Getting a a.foreach is not a function error
body: <p>I am trying to build a multiselect list using angular js. I am getting a weird TypeError: a.foreach is not a function and I can’t seem to figure out when. </p>
  
  <p>js : </p>
  
  <pre><code>var myAppModule = angular.module('multiselect', []);
  
   myAppModule.controller("view", function ($scope) {
  $scope.listA = {
      values: [{
          id: 1,
          label: 'aLabel',
          subItem: {
              name: 'aSubItem'
          }
  }, {
          id: 2,
          label: 'bLabel',
          subItem: {
              name: 'bSubItem'
          }
  }],
      selected: {
          name: 'aSubItem'
      }
  
  };
  
  
  })
  </code></pre>
  
  <p>html: </p>
  
  <pre><code> &lt;select multiple ng-options="item.subItem as item.label for item in listA.values track by item.id" ng-model="listA.selected"&gt;&lt;/select&gt;
  </code></pre>
  
  <p>I don’t know what I could be doing wrong. Am I casting something wrong ?</p>