I have a problem with angularJS service $location. I use it to retrieve the "GET" parameters from a URL. The problem is that it disables all hyperlinks on the page (if not open on a new tab). Therefore, if you click on the link, this will change the URL, but the page will remain the same.
What can i do with this?
Angularjs v1.2.16
var myApp = angular.module('rtApp', [])
.config(['$locationProvider', function($locationProvider) {
$locationProvider
.html5Mode(true);
}])
.service('Product', ['$http','$location',function($http, $location) {
var url = '/shop/product_data.php',
query = $location.search();
var service = $http.post(url, query).then(function (r) {
if (r.status === 200) {
return r.data;
} else {
return false;
}
});
return service;
}]);
source
share