title: Angularjs: how to handle parameter in url with routing
body: <p>My URL scheme is as follows:</p>
  
  <pre><code>/drive/Fertilisation?open=potasse
  </code></pre>
  
  <p>I get to a page as follows:</p>
  
  <pre><code>&lt;a ng-click="openPageUrl('/drive/Fertilisation?open=potasse')"&gt;open corn page&lt;/a&gt;
  </code></pre>
  
  <p>In the controller, openPageUrl is as follows:</p>
  
  <pre><code>$scope.openPageUrl = function (url) {
      closePopover();
      console.log("Open page url "+url);
      $location.url(url);
  };
  </code></pre>
  
  <p>Still in the controller, the route is handled, the controller handle $routeParam like this:</p>
  
  <pre><code>// Potential popup to open
  $scope.openPopupOnLoad = $routeParams.open;
  console.log("$scope.openPopupOnLoad = "+$scope.openPopupOnLoad +"; $routeParams.open = "+ $routeParams.open);
  </code></pre>
  
  <p>But it sounds like the controller loose the param, logs are as follows:</p>
  
  <pre><code>[Log] Open page url /drive/Fertilisation?open=potasse (kws.corn.app.js.html, line 8581)
  [Log] Open page url /drive/Fertilisation (kws.corn.app.js.html, line 8581)
  [Log] App controller: boots up Tue Jul 29 2014 22:54:42 GMT+0200 (CEST)
  [Log] $scope.openPopupOnLoad = undefined; $routeParams.open = undefined (kws.corn.app.js.html, line 607)
  [Log] App controller: already executed, won't do it again except routes (kws.corn.app.js.html, line 610)
  [Log] App controller: boots up done Tue Jul 29 2014 22:54:42 GMT+0200 (CEST) (kws.corn.app.js.html, line 632)
  </code></pre>
  
  <p>How would you handle the param?</p>