Using a Relative Path for a Service Call in AngularJS

后端 未结 9 2090
别跟我提以往
别跟我提以往 2020-11-28 03:51

I have the following code, which was working fine until I deployed to a test server:

$scope.getUserList = function (userName) {
    $http({
        method: \         


        
9条回答
  •  北荒
    北荒 (楼主)
    2020-11-28 04:21

    Use the $location service - it will return your path, the hash, the server address.. Everything you need! Your call would be to $location.path()+"/GetUserList" or something similar.

    See here: http://docs.angularjs.org/guide/dev_guide.services.$location

提交回复
热议问题