title: deselect select2 in angularjs
body: <p>I'm using <a href="https://github.com/angular-ui/ui-select2/blob/master/src/select2.js" rel="nofollow">https://github.com/angular-ui/ui-select2/blob/master/src/select2.js</a> to work on select2 with angularjs. There is a <strong>button to reset select2 (i.e, set placeholder)</strong>. On clicking button, I have to call a function from angular controller. In that function, I have to reset select2. I don't know how to do. I'm new in angularjs. So I can't understand directive. If anyone knows the solution with explanation, it will be appreciated.</p>
  
  <p>Here is my code till now,</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;select class="form-control" ui-select2="select2Options" id="ddlTechnology" name="ddlTechnology" ng-model="technology" ng-change="changeData('technology', technology)" ng-options="tech as tech.st_name for tech in technologies" style="width: 100%;"&gt;
      &lt;option value=""&gt;&lt;/option&gt;
  &lt;/select&gt;
  &lt;button ng-click="resetSearch()"&gt;Reset&lt;/button&gt;
  </code></pre>
  
  <p><strong>JS</strong></p>
  
  <pre><code>$scope.technologies = [{
      $hashKey: "object:14",
      in_technology_id: 1,
      st_name: "Networking"},
      {},
      {},
      ...
  ];
  $scope.resetSearch = function () {
      $("#ddlTechnology").select2('val', '');
  }
  </code></pre>