I have the following code, which was working fine until I deployed to a test server:
$scope.getUserList = function (userName) {
$http({
method: get,
url: GetUserList,
params: { userName: userName }
}).
success(function (data) {
$scope.users = data;
}).
error(function () {
alert(Error getting users.);
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.
What I would like to know is the right way to reference the service URL in a way that is portable and maintainable in Angular.