Whats the better way to identify the context path in Angular JS

后端 未结 7 1051
清酒与你
清酒与你 2021-02-05 20:38

I have my web application deployed to tomcat with an applicatio context. For example my URL looks something like this.

http://localhost:8080/myapp
7条回答
  •  野的像风
    2021-02-05 21:03

    For AngularJS $http service you are good to go with url : 'getusers', as follows:

    $scope.postCall = function(obj) {
                $http({
                    method : 'POST',
                    url : 'getusers',
                    dataType : 'json',
                    headers : {
                        'Content-Type' : 'application/json'
                    },
                    data : obj,
                });
    };
    

提交回复
热议问题