javascript - AngularJS $location.search do not reload page -


as title says, $location.search not reload page, updates url. code:

var app = angular.module('myapp', [], function($locationprovider) {         $locationprovider.html5mode(true);     });     app.controller('mytablectrl', function($scope, $location, $http) {         $scope.target = $location.search()["categoryid"];         $http.get("api/topcategories")         .success(function(response) {$scope.names = response;});                             });  

any suggestions? there alternative code?

edit: $location.search search parameter in category.html?categoryid=any_number . takes any_number number , has compare value. however, try press href updates url, not reloads page.

i added target="_self" in href tags , works perfectly.


Comments