title: angular-ui: ui-router dynamic routes and states
body: <p>I have a dynamic route defined as:</p>
  <pre><code>$urlRouterProvider
      .when(
          '/:resource?collection&amp;type&amp;id',
          [
              '$match', '$stateParams',
              function routeValidator( $match , $stateParams )
              {
                  var path = '';
                  angular.forEach($match, function joinner( val , key )
                  {
                      if ( angular.isDefined(val) ) path += '/' + val;
                  });
                  return path;
              }
          ]
      )
      .when( '' , '/about' )
      .when( '/' , '/about' )
      .otherwise( '/404' );
  </code></pre>
  <p>And then several states:</p>
  <pre><code>$stateProvider
      .state('about',
          {
              &quot;url&quot;:          &quot;/about&quot;,
              &quot;templateUrl&quot;:  &quot;about.tmpl&quot;
          }
      )
      //…
  </code></pre>
  <p>I try hitting <code>index.html#/</code> or <code>index.html#/about</code>, and none of my states are getting invoked (and subsequently none of my controllers). BUT my routes are obeyed (ex '' gets redirected to '/about'). No console errors and values return as expected (ex. for <code>index.html#/about</code>, $match &amp; path = <code>/about</code>).</p>
  <h1>Edit</h1>
  <p>It seems Require is part of the issue:</p>
  <ul>
  <li><a href="http://jsfiddle.net/jshado1/vuR3k/4/" rel="nofollow noreferrer">Here</a> it's working in jsfiddle without require.</li>
  <li><a href="http://plnkr.co/edit/JJ3WUG2k9eHxuDcgVT6P" rel="nofollow noreferrer">Here</a> it's <em>not</em> working in plunker with require.</li>
  </ul>