title: ng-options with object data source
body: <p>I'm struggling to understand how ng-options works with a data source. I've read the docs and I feel like I'm doing exactly what is required, but I still get problems when attempting. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html ng-app="app"&gt;
    &lt;head&gt;
      &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.min.js"&gt;              &lt;/script&gt;
      &lt;link rel="stylesheet" href="style.css" /&gt;
      &lt;script type="text/javascript"&gt;
        angular.module('app', [])
        .controller('IndexCtrl', ['$scope', function($scope) {
          $scope.types = {
            1: "value1",
            2: "value2",
            5: "value3"
          };
        }]);
      &lt;/script&gt;
    &lt;/head&gt;
    &lt;body ng-controller="IndexCtrl"&gt;
      &lt;select ng-model="type" ng-options="k as v for(k, v) in types"&gt;
        &lt;option value=""&gt;Select Type&lt;/option&gt;
      &lt;/select&gt;
    &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I always get this error in the console:</p>
  
  <p>Error: </p>
  
  <blockquote>
    <p>Expected ngOptions in form of '<em>select</em> (as <em>label</em>)? for (<em>key</em>,)?<em>value</em> in <em>collection</em> (track by <em>expr</em>)?' but got 'k as v for(k, v) in types'.</p>
  </blockquote>
  
  <p>What am I doing incorrectly? </p>
  
  <p>See plunkr here: </p>
  
  <p><a href="http://plnkr.co/edit/Bl6u4151KyDkxhYrsdCm?p=preview" rel="noreferrer">http://plnkr.co/edit/Bl6u4151KyDkxhYrsdCm?p=preview</a></p>