title: AngularJS: Custom 'select' directive - wrong ng-model value in angular 1.2.6/7
body: <p>i'm trying to create simple directive, which could be used like this </p>
  
  <pre><code>&lt;select custom-select="types.SOME_TYPE" ng-model="a.SELECT" /&gt;
  </code></pre>
  
  <p>my directive:</p>
  
  <pre><code>m.directive('customSelect', function () {
    return {
      restrict: 'A',
      replace: true,
      scope: {
        selectModel: '=ngModel',
        options: '=customSelect'
      },             
      template: '&lt;div&gt;&lt;select name="selectModel" id="selectModel"\
                 required ng-model="selectModel" \
                 ng-options="o.key as o.label for o in options"&gt;\
                 &lt;option style="display:none" value=""&gt;Wybierz...&lt;/option&gt;\
               &lt;/select&gt;&lt;/div&gt;',
      compile: function compile(element, attrs) {
        return function postLink(scope, iElement, iAttrs) {            
        };
      }
    };
  });
  </code></pre>
  
  <p>it works fine in angular 1.1.6, but it doesn't work properly in angular 1.2.6/1.2.7 - strange value is set for variable defined in <code>ng-model</code> (<code>a.SELECT</code> in this example)</p>
  
  <p>If types.SOME_TYPE is array:</p>
  
  <pre><code>[
      {
        "key":"KEY_1",
        "label":"Label 1"
      },
      {
        "key":"KEY_2",
        "label":"Label 2"
      }
  ]
  </code></pre>
  
  <p>then a.SELECT will have these values:</p>
  
  <ol>
  <li>for angular 1.1.6 it will be "KEY_1" or "KEY_2" - that's cool</li>
  <li>for angular 1.2.6/7
      it will be "? string:KEY_1 ?" or "? string:KEY_2 ?" - that's strange!</li>
  </ol>
  
  <p>Under angular 1.2.6/7 it works fine only if I'm using directive like this:</p>
  
  <pre><code>&lt;some-no-select-tag custom-select="types.SOME_TYPE" ng-model="a.SELECT" /&gt;
  </code></pre>
  
  <p>Here is a demo: <kbd><a href="http://plnkr.co/edit/la4TEyh53BxZufYZH3FX?p=preview" rel="nofollow">Plunker</a></kbd></p>