i have a challenge with routing on angularJS to conform with the base url set in the config on code igniter
base url = http://localhost:8080/example/
for example if my current url is
http://localhost:8080/example/details
and there's angular service call from the Angular controller of that page like this
$http.get("api/gallery/" + 4).success(function (data) {
        galleryResource.getAll().$promise.then(function (response) {
            console.log(response);
        }, function (response) {
            console.log(response);
        });
the url called will be
http://localhost:8080/example/api/gallery/4
but when the url is now
http://localhost:8080/example/details/4
and thesame service is called the url that will be called will be
http://localhost:8080/example/details/api/gallery/4
my question now is, is there a way to ensure that api url does not follow the current url in the address bar for starts from the base url because with the example above i want the api url to be
http://localhost:8080/example/api/gallery/4
while am on the page with url
http://localhost:8080/example/details/4 Thanks in anticipation of your responses``