title: Using ng Repeat inside a custom directive to populate a select dropdown
body: <p>I was having a trouble populating a selected dropdown with an ng Repeat inside a custom directive. I've found this example that looks very similar to what I want to achieve <a href="http://plnkr.co/edit/W1MMx7vjKKXFuV8LbBjJ?p=preview" rel="nofollow">http://plnkr.co/edit/W1MMx7vjKKXFuV8LbBjJ?p=preview</a>. It seems to work, but not mine though.</p>
  
  <p><strong>The goal</strong>: Get the select dropdown to display array of options from a testArray</p>
  
  <p>Plunkr: <a href="http://plnkr.co/edit/XMwFKTYRgqYzOcsUMDEp?p=preview" rel="nofollow">http://plnkr.co/edit/XMwFKTYRgqYzOcsUMDEp?p=preview</a></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>var app = angular.module('myapp', []);
  
  app.controller('mainController', function($scope) {
    $scope.testArray = [{'option' : '1' }, {'option': '2'}, {'option': '3' }];
    $scope.testModel = {};
  });
  
  app.directive('testDirective', function() {
    return {
      scope: {
        dataHeldmodel: '=',
        dataOptions: '='
      },
      template: '&lt;select name="dataHeldmodel" data-ng-model="dataHeldmodel"&gt;' +
                      '&lt;option value=""&gt;Select&lt;/option&gt;' +
                      '&lt;option value="{{option.option}}" data-ng-repeat="option in dataOptions"&gt;{{option.option}}&lt;/option&gt;' +
                  '&lt;/select&gt;',
      replace: true
    }
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://code.angularjs.org/1.4.3/angular.js"&gt;&lt;/script&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html data-ng-app="myapp"&gt;
  
    &lt;head&gt;
      &lt;link rel="stylesheet" href="style.css" /&gt;
      &lt;script data-require="angular.js@1.4.3" data-semver="1.4.3" src="https://code.angularjs.org/1.4.3/angular.js"&gt;&lt;/script&gt;
      &lt;script src="script.js"&gt;&lt;/script&gt;
    &lt;/head&gt;
  
    &lt;body data-ng-controller="mainController"&gt;
      &lt;test-directive data-options="testArray" data-heldmodel="testModel"&gt;&lt;/test-directive&gt;
    &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>