title: AngularJS - UI Router - programmatically add states
body: <p>Is there a way to programmatically add states to $stateProvider after module configuration, in e.g. service ? </p>
  
  <p>To add more context to this question, I have a situation where I can go with two approaches:</p>
  
  <ol>
  <li>try to force the reload on the state defined in the module configuration, the problem is that state has a <strong>reloadOnSearch</strong> set to <strong>false</strong>, so when I try <em>$state.go('state.name', {new:param}, {reload:true});</em> nothing happens, any ideas ?</li>
  </ol>
  
  <p>State definition </p>
  
  <pre><code>.state('index.resource.view', {
    url: "/:resourceName/view?pageNumber&amp;pageSize&amp;orderBy&amp;search",
    templateUrl: "/resourceAdministration/views/view.html",
    controller: "resourceViewCtrl",
    reloadOnSearch: false,
  })
  </code></pre>
  
  <ol start="2">
  <li>try to programmatically add states that I need to load from a service so routing can work properly. I'd rather go with the first option if possible.</li>
  </ol>