title: ng-controller calling twice when ng-click=function() in dropddown
body: <p>I am using a simple dropdown. When I am click on dropdown menu a function in page is called twice and hence controller is also calling twice.</p>
  
  <p>Here is my code :</p>
  
  <pre><code>&lt;div class="dropdown col-md-3"&gt;
      &lt;button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown"&gt;{{selectName}}
          &lt;span class="caret"&gt;&lt;/span&gt;&lt;/button&gt;
      &lt;ul class="dropdown-menu"&gt;
          &lt;li ng-repeat="searchDealer in searchDealers"&gt;
              &lt;!--&lt;a ui-sref="app.dashboard.v1.summary({searchId: searchDealer.siteId?searchDealer.siteId:0, startDate: (startDate | date: 'MM/dd/yyyy'), endDate: (endDate| date: 'MM/dd/yyyy')})" ui-sref-opts="{reload: true}" ng-click="change(searchDealer)"&gt;--&gt;
              &lt;a ng-click="loadNewUrl();"&gt;
                  {{searchDealer.dealerName}}
              &lt;/a&gt;
          &lt;/li&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  $scope.loadNewUrl = function () {
      if ($scope.getCurrentPage() === "dashboard") {
          $state.go("app.dashboard.v1." + $scope.getCurrentTab(), {searchId: ($stateParams.searchId ? $stateParams.searchId : 0), startDate: $('#startDate').val(), endDate: $('#endDate').val()});
      } else if ($scope.getCurrentPage() === "report") {
  
          $state.go("app.report.reports", {searchId: ($stateParams.searchId ? $stateParams.searchId : 0), startDate: $('#startDate').val(), endDate: $('#endDate').val()});
      } else if ($scope.getCurrentPage() === "dealer") {
          $state.go("app.admin.dealer", {searchId: ($stateParams.searchId ? $stateParams.searchId : 0), startDate: $('#startDate').val(), endDate: $('#endDate').val()});
      } else if ($scope.getCurrentPage() === "conversion") {
          $state.go("app.conversion.conversion", {searchId: ($stateParams.searchId ? $stateParams.searchId : 0), startDate: $('#startDate').val(), endDate: $('#endDate').val()});
      } else {
          $location.path("/" + "?startDate=" + $('#startDate').val() + "&amp;endDate=" + $('#endDate').val());
      }
  };
  $scope.getCurrentPage = function () {
      var url = window.location.href;
      if (url.indexOf("dealer") &gt; 0) {
          return "dealer";
      }
      if (url.indexOf("report") &gt; 0) {
          return "report";
      }
      if (url.indexOf("conversion") &gt; 0) {
          return "conversion";
      }
      return "dashboard";
  };
  $scope.getCurrentTab = function () {
      var url = window.location.href;
      if (url.indexOf("url") &gt; 0) {
          return "url";
      }
      if (url.indexOf("media") &gt; 0) {
          return "media";
      }
      return "summary";
  };
  &lt;!-- end snippet --&gt;
  </code></pre>