title: Error: [$injector:unpr] Unknown provider: $stateProvider
body: <p>I'm getting an error trying to use ui.router:</p>
  
  <pre><code>Uncaught Error: [$injector:modulerr] Failed to instantiate module bApp due to:
  Error: [$injector:unpr] Unknown provider: $stateProvider
  http://errors.angularjs.org/1.4.5/$injector/unpr?p0=%24stateProvider
  at REGEX_STRING_REGEXP (http://localhost:9000/bower_components/angular/angular.js:68:12)
  at http://localhost:9000/bower_components/angular/angular.js:4284:19
  at getService (http://localhost:9000/bower_components/angular/angular.js:4432:39)
  at Object.invoke (http://localhost:9000/bower_components/angular/angular.js:4464:13)
  at runInvokeQueue (http://localhost:9000/bower_components/angular/angular.js:4379:35)
  at http://localhost:9000/bower_components/angular/angular.js:4388:11
  at forEach (http://localhost:9000/bower_components/angular/angular.js:336:20)
  at loadModules (http://localhost:9000/bower_components/angular/angular.js:4369:5)
  at createInjector (http://localhost:9000/bower_components/angular/angular.js:4294:11)
  at doBootstrap (http://localhost:9000/bower_components/angular/angular.js:1655:20)
  http://errors.angularjs.org/1.4.5/$injector/modulerr?p0=bApp&amp;p1=Error%3A%20…F%2Flocalhost%3A9000%2Fbower_components%2Fangular%2Fangular.js%3A1655%3A20)
  </code></pre>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>angular.module('bApp', ['ui.router']);
  angular.module('bApp').config(function($stateProvider, $urlRouterProvider) {
      urlRouterProvider.otherwise('/');
  
      $stateProvider
          .state('main', {
              url: "/",
              templateUrl: "/views/main.html"
          })
  
      .state('register', {
          url: "/register",
          templateUrl: "/views/register.html"
         
      });
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!doctype html&gt;
  &lt;html&gt;
  
  &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;meta name="description" content=""&gt;
      &lt;meta name="viewport" content="width=device-width"&gt;
      &lt;!-- bower:css --&gt;
      &lt;link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css" /&gt;
      &lt;!-- endbower --&gt;
      &lt;!-- endbuild --&gt;
      &lt;!-- build:css(.tmp) styles/main.css --&gt;
      &lt;link rel="stylesheet" href="styles/bootstrap-hero.css"&gt;
      &lt;link rel="stylesheet" href="styles/main.css"&gt;
      &lt;!-- endbuild --&gt;
      &lt;!-- build:js(.) scripts/vendor.js --&gt;
    
      &lt;script src="bower_components/jquery/dist/jquery.js"&gt;&lt;/script&gt;
      &lt;script src="bower_components/angular/angular.js"&gt;&lt;/script&gt;
      &lt;script src="bower_components/bootstrap/dist/js/bootstrap.js"&gt;&lt;/script&gt;
      &lt;script src="bower_components/angular-ui-router/release/angular-ui-router.js"&gt;&lt;/script&gt;
  
      &lt;!-- endbuild --&gt;
  
  
  &lt;/head&gt;
  
  &lt;body ng-app="bApp"&gt;
  
      &lt;!--[if lte IE 8]&gt;
        &lt;p class="browsehappy"&gt;You are using an &lt;strong&gt;outdated&lt;/strong&gt; browser. Please &lt;a href="http://browsehappy.com/"&gt;upgrade your browser&lt;/a&gt; to improve your experience.&lt;/p&gt;
      &lt;![endif]--&gt;
  
      &lt;!-- Add your site or application content here --&gt;
      &lt;div class="header"&gt;
          &lt;div class="navbar navbar-default" role="navigation"&gt;
              &lt;div class="container"&gt;
                  &lt;div class="navbar-header"&gt;
  
                      &lt;a class="navbar-brand" href="#/"&gt;b&lt;/a&gt;
                  &lt;/div&gt;
                  &lt;ul class="nav navbar-nav"&gt;
                      &lt;li&gt;&lt;a ui-sref="main"&gt;Home&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a ui-sref="register"&gt;Register&lt;/a&gt;&lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
  
      &lt;div ui-view&gt;&lt;/div&gt;
  
  
      &lt;!-- build:js({.tmp,app}) scripts/scripts.js --&gt;
    
      &lt;script src="scripts/app.js"&gt;&lt;/script&gt;
      &lt;script src="scripts/controllers/main.js"&gt;&lt;/script&gt;
      &lt;script src="scripts/controllers/register.js"&gt;&lt;/script&gt;
      &lt;script src="scripts/app.config.js"&gt;&lt;/script&gt;
      &lt;!-- endbuild --&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I'm trying to use ui.router but it is failing.</p>