Using a Relative Path for a Service Call in AngularJS

后端 未结 9 2079
别跟我提以往
别跟我提以往 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条回答
  •  猫巷女王i
    2020-11-28 03:58

    I would just make all URL relative.

    url: "../GetUserList",
    

    instead

    url: "GetUserList",
    

    Hard coding for the, dose not sound good idea to me as you might need to change this environment to environment, and has dependency over virtual directory name.

提交回复
热议问题