R
R
Roman L.2015-11-18 15:49:29
Angular
Roman L., 2015-11-18 15:49:29

How to change the URL without reloading the page?

Hey!
Or even how to organize a search, with 10+ parameters, so that the url is saved.
.when('/search',
{
templateUrl: html,
controller: 'SearchCtrl'
})
There is a form with different controls whose events the model is updated with.
I can’t figure out how to push a parameter there, delete change. How to organize?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nicholas, 2015-11-18
@healqq

Hmm... Do you want the filter to be displayed in the url, but the page does not refresh?
You can do it like this:

.when('/search?param1&param2&.....&paramN',
{
  templateUrl: html,
  reloadOnSearch: false
  controller: 'SearchCtrl'
})

To change the location, use the function:
$location.serach(
  {
       param1: 1,
       param2: 2
  }
);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question