title: Using a Relative Path for a Service Call in AngularJS
body: <p>I have the following code, which was working fine until I deployed to a test server:</p>
  
  <pre><code>$scope.getUserList = function (userName) {
      $http({
          method: "get",
          url: "GetUserList",
          params: { userName: userName }
      }).
          success(function (data) {
              $scope.users = data;
          }).
          error(function () {
              alert("Error getting users.");
  </code></pre>
  
  <p>The problem is that I deployed to a virtual directory, and the call below is attempting to hit GetUserList from the server root.  This makes sense, and I know a number of ways to fix it.</p>
  
  <p>What I would like to know is the <em>right</em> way to reference the service URL in a way that is portable and maintainable in Angular.</p>