title: Trigger state in button tag using ui-sref
body: <p>What is the elegant way to trigger a state with <code>angular-ui-router</code> by clicking <code>&lt;button&gt;</code>?</p>
  
  <p>I am using <code>ui-sref="main"</code> and it doesn't seem to work although it works with <code>&lt;a&gt;</code> though. </p>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html ng-app="plunker"&gt;
  
  &lt;head&gt;
    &lt;meta charset="utf-8" /&gt;
    &lt;title&gt;AngularJS Plunker&lt;/title&gt;
    &lt;link data-require="bootstrap-css@3.1.1" data-semver="3.1.1" rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" /&gt;
    &lt;script&gt;
      document.write('&lt;base href="' + document.location + '" /&gt;');
    &lt;/script&gt;
    &lt;link rel="stylesheet" href="style.css" /&gt;
    &lt;script data-require="angular.js@1.2.x" src="http://code.angularjs.org/1.2.13/angular.js" data-semver="1.2.13"&gt;&lt;/script&gt;
    &lt;script src="http://angular-ui.github.io/ui-router/release/angular-ui-router.js" &gt;&lt;/script&gt;
    &lt;script src="app.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body ng-controller="MainCtrl"&gt;
  
    &lt;nav class="navbar navbar-default"&gt;
      &lt;div class="navbar-header"&gt;
        &lt;a class="navbar-brand" href="#"&gt;Brand&lt;/a&gt;
      &lt;/div&gt;  
      &lt;ul class="nav navbar-nav navbar-left"&gt;
        &lt;li&gt;
          &lt;button class="btn btn-danger navbar-btn" ui-sref="main" &gt;Button Submit&lt;/button&gt;
        &lt;/li&gt;
        &lt;li&gt;
          &lt;a class="btn btn-danger navbar-btn" ui-sref="main" &gt;Anchor Link Submit&lt;/a&gt;
        &lt;/li&gt;
      &lt;/ul&gt;
    &lt;/nav&gt;
  
  
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>Javascript</strong>:</p>
  
  <pre><code>var app = angular.module('plunker', ['ui.router']);
  
  'use strict';
  
  app.config(['$stateProvider', '$urlRouterProvider', '$locationProvider', function($stateProvider, $urlRouterProvider, $locationProvider) {
  
    $stateProvider
      .state("main", {
        url: "/main",
        resolve: {
          test: function() {
            alert("Triggered main state");
            return true;
          }
        }
      });
  
  }]);
  
  
  app.controller('MainCtrl', function($scope) {
    $scope.name = 'World';
  });
  </code></pre>
  
  <p>Link: <a href="http://plnkr.co/edit/vMtLN0ncpqAfgM6S1Ng4?p=preview" rel="noreferrer">http://plnkr.co/edit/vMtLN0ncpqAfgM6S1Ng4?p=preview</a></p>