title: How to hide some params in URL with AngularJS UI Router?
body: <p>I wanted to define a route that received one mandatory param and another optional param that would be hidden in the URL. It would be something like:</p>
  <pre><code>http://www.myapp.com/viewingPodcast/4
  </code></pre>
  <p>and the hidden param still available but not shown in the URL.</p>
  <p>I am using <code>ng-href</code> + <code>$state.href</code> to get the url.
  I also have looked at <a href="https://stackoverflow.com/a/37425668/6251097">this</a> answer and it's comments but I still couldn't get it to work with my version.</p>
  <p>This is my state config</p>
  <pre class="lang-js prettyprint-override"><code>
  .state(&quot;viewingPodcast&quot;, {
            ...
            url: &quot;/podcast/:id&quot;,
            controller: &quot;podcastCtrl&quot;,
            templateUrl: ...,
            params: { zineId: null },
            data: {
             ...
            },
            resolve: {
              ...
            },
          })
  </code></pre>
  <p>And the $state.href:</p>
  <pre class="lang-js prettyprint-override"><code>...
  $state.href(&quot;viewingPodcast&quot;, { id: content.id, zineId: content.zineId });
  ...
  </code></pre>
  <p>Both values (id and zineId) are not nulled when debugging the <code>$state.href</code> line.
  I tried, like mentioned in the comments of the answer above:</p>
  <pre class="lang-js prettyprint-override"><code>$state.href(&quot;viewingPodcast&quot;, { id: content.id, zineId: { zineId: content.zineId } });
  </code></pre>
  <p>but when entering the controller and checking the params (with <code>$state.params.zineId</code>) the value is null.</p>
  <p>I don't know if I'm doing something wrong and I still can't comment to ask on the other answer so I'm stuck creating a new question.</p>
  <p>Thanks in advance</p>