AngularJS change url with $location

Angular enforces the idea of one page web app. Browsers don't take any actions on change of anything after '#' value. So the best practice is to add variable attributes in url after '#' value which will keep the base url and attribute look clean on browser's address bar as well as solve your problem. My advice is to keep username, page no. , or any specific attribute id after '#' value. In your case you should use something like above said

www.myUrl.com/#/inbox/25

or

www.myUrl.com/inbox/#/25


usually angular URLs look like

www.myurl.com/#/inbox/1

in which case

$location.url('/inbox/25');

should work for you