title: Why angular $route.current.params is empty?
body: <p>I have made provider for holding some settings data and among them are URL query parameters.
  Here is the code:</p>
  
  <pre><code>angular
    .module('myApp', [
      'ngResource',
      'ngRoute'
    ])
    .provider('settings', function(){
      this.$get = function($route, $location){
        var p1 = $route.current.params.param1;
        var p2 = $route.current.params.param2;
        return {
          param1: p1,
          param2: p2
        };
      };
    });
  </code></pre>
  
  <p>But <code>$route.current.param</code> is empty and I am wondering why?
  In order to access query params I need to use something like this function:</p>
  
  <pre><code>function getQueryVariable(variable) {
      if(!window || !window.location || !window.location.search){
          return undefined;
      }
      var query = window.location.search.substring(1);
      var vars = query.split('&amp;');
      for (var i = 0; i &lt; vars.length; i++) {
          var pair = vars[i].split('=');
          if (decodeURIComponent(pair[0]) == variable) {
              return decodeURIComponent(pair[1]);
          }
      }
      return undefined;
  }
  </code></pre>
  
  <p>My question is why <code>$route.current.params</code> is empty?</p>
  
  <p>Here is interesting info I have found meanwhile:</p>
  
  <p>When accessing via url <a href="http://localhost:9000/?param1=aaa&amp;param2=bbb" rel="nofollow">http://localhost:9000/?param1=aaa&amp;param2=bbb</a>
  then  <code>$route.current.params</code> is <code>empty</code>, but when accesing via url <a href="http://localhost:9000/#?param1=aaa&amp;param2=bbb" rel="nofollow">http://localhost:9000/#?param1=aaa&amp;param2=bbb</a> 
  then  <code>$route.current.params</code> is <code>NOT empty</code>.</p>
  
  <p>So adding <code>#</code> before question mark makes difference!</p>
  
  <p>Still not clear why.</p>