title: Dynamic optional ui.router $stateParams?
body: <p>Is it possible to have dynamic ui.router <code>$stateParams</code> parameters?  IF a user supplies parameters on the route, I simply want to address them by name or ordinal position.  However, I don't want to define them on every single state.</p>
  
  <p>Something like this...</p>
  
  <pre><code>.state('selector', {
      url: '/select/:brandId/:userId/:appId/:appVerId/:featureId/:dialogId/:controlId/:token',
      template: null,
      controller: 'Selector',
      params: {
          brandId     : { squash: true, value: null },
          userId      : { squash: true, value: null },
          appId       : { squash: true, value: null },
          appVerId    : { squash: true, value: null },
          featureId   : { squash: true, value: null },
          dialogId    : { squash: true, value: null },
          controlId   : { squash: true, value: null },
          token       : { squash: true, value: null }
      }
  })
  </code></pre>
  
  <p>... or this ...</p>
  
  <pre><code>.state('selector', {
      url: '/select/:a/:b/:c/:d/:e/:f/:g/:h',
      template: null,
      controller: 'Selector',
      params: {
          a : { squash: true, value: null },
          b : { squash: true, value: null },
          c : { squash: true, value: null },
          d : { squash: true, value: null },
          e : { squash: true, value: null },
          f : { squash: true, value: null },
          g : { squash: true, value: null },
          h : { squash: true, value: null }
      }
  })
  </code></pre>
  
  <p>I would like to access them by name or with the ordinal position...</p>
  
  <pre><code>var a = $stateParams.a; // or
  var b = $stateParams[1];
  </code></pre>
  
  <p>This would allow the following URLs to be valid:</p>
  
  <pre><code>http://adsf.com/selector  
  http://adsf.com/selector/////217H3  
  http://adsf.com/selector/23AD/12D///217H3
  </code></pre>