How can I set a query parameter in AngularJS without doing a route?

In your $routeProvider configuration set reloadOnSearch to false:

$routeProvider
  .when('/items', {
    controller: 'ItemsCtrl',
    templateUrl: '/templates/items',
    reloadOnSearch: false
  },
  ...
);

and in your controller use $location.search() to set the id param:

$location.search('id', 123);

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)