angularjs - Change route parameters without updating view -


i'm trying figure out how change route parameters without reloading entire page. example, if start at

http://www.example.com/#/page

but update name 'george', change route be:

http://www.example.com/#/page/george

if had http://www.example.com/#/page/:name routed.

without reloading location. can 1 set $routeparams.name = "george" ?

edit: alternatively, there way update http://www.example.com/#/page?name=george without reloading or resetting page?

ok, after lot of searching. answered own question.

i've discovered finding on angular documentation incredibly impossible, sometimes, once it's found, changes how thinking problem.

i began here: http://docs.angularjs.org/api/ng.$location took me here: http://docs.angularjs.org/guide/dev_guide.services.$location took me question: angularjs paging $location.path no ngview reload

what ended doing: added $location.search({name: 'george'}); wanted change name (a $scope.$watch).

however, still reload page, unless in bottom stackoverflow link , add parameter object pass $routeprovider.when. in case, looked like: $routeprovider.when('/page', {controller: 'myctrl', templateurl:'path/to/template', reloadonsearch:false}).

i hope saves else headache.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -