title: angular encode url search string
body: <p>how do i encode the keyword that get sent to the server and then decode it?</p>
  
  <p>I can't search for keywords containing chars like .? or / at the moment.</p>
  
  <p><strong>The code displaying is wrong because endpoint returns a object.</strong></p>
  
  <pre><code> self.search = function (keyword) {
              var endpoint = $location.path(baseEndpoint + "search/").search(keyword),
                  deferred = $q.defer();
  
              $http.get(HttpRequestUrlHelper.ensureUniqueRequestUrl(endpoint), {
              }).success(function (response) {
                  deferred.resolve(response);
              }).error(function (error) {
                  deferred.reject(error);
              });
  
              return deferred.promise;
          }
  </code></pre>
  
  <p>If i use encodeURIComponent() my url is encoded but my controller isn't hit:</p>
  
  <pre><code>request url =&gt; /todo/search/Leka%20med%20barnen.?UniqueKey=1404655031784 angular.js:9159
  GET http://localhost:49195/todo/search/Leka%20med%20barnen.?UniqueKey=1404655031784 404 (Not Found) 
  </code></pre>