title: Angular directive error unexpected string
body: <p>I am trying to create an angular directive that will initialise the <a href="https://github.com/select2/select2-bootstrap-theme#readme" rel="nofollow">select2</a>, this directive will be used in select tag as below </p>
  
  <pre><code>&lt;select ng-model="add.doctype" class="form-control select2" select2 append-to-body ng-options="x.tipe for x in ::Types"&gt;
      &lt;option value=""&gt;&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>And the directive is</p>
  
  <pre><code>(function() {
      'use strict';
  
      angular.module('myapp.theme')
          .directive('select2', select2);
  
      function select2() {
          return {
              $(".select2").select2({ theme: "bootstrap" });
          };
      }
  
  })();
  </code></pre>
  
  <p>it gave an error in console <code>Unexpected string</code> pointed to <code>$(".select2").select2({ theme: "bootstrap" });</code>, did i miss something there?</p>