title: Setting dynamic parameters in URL with Angular UI Router
body: <p>I am using query system which allows user to construct query from list of dynamic fields and I want to persist query in URL.</p>
  
  <p>Normally I would do:</p>
  
  <pre><code>$stateProvider.state('alerts', {
                  url: '/alerts/list?p1&amp;p2&amp;p3'
              })
  </code></pre>
  
  <p>and in controller I could read params with $stateParam:</p>
  
  <pre><code>console.log($stateParams.p1)
  </code></pre>
  
  <p>I could save query in URL by:</p>
  
  <pre><code>$state.go($state.current, {p1:'1', p2: '2'}, {location: true, inherit:true, notify:false})
  </code></pre>
  
  <p>But the problem is I cannot declare all params.</p>
  
  <p>I would like to do:</p>
  
  <pre><code>$state.go($state.current, {p1:'1', p2: '2', p3:'3', p4: '4', p5:'5'}, {location: true, inherit:true, notify:false})
  </code></pre>
  
  <p>but ui-router ignores params that are no declared for state.</p>
  
  <p>I know $location.search gives me access to URL search part but how can I set URL (without changing state and reloading page)?</p>