I have my web application deployed to tomcat with an applicatio context. For example my URL looks something like this.
http://localhost:8080/myapp
In general, you should use injection in your controller like the following:
angular.module("yourModule").controller("yourController", ["$scope", "yourService", "$location", function($scope, yourService, $location){
....
//here you can send the path value to your model.
yourService.setPath($location.path());
....
}]);