I want to add query params and hash to a url from controller without reloading the page.
var param [
query: "abc",
page : 1
];
$location.url("/project").search(param);
This changes the url from domainname.com to domainname.com/project?query=abc&page=1 which is fine but I also want to add div id to the url using hash. I want my url to be donainname.com/project?query=abc&page=1#result . How to achieve this any suggesstion or comments ? One thing should be taken care of that query params and hash should be added in one go as I have written a function which gets call when url changes otherwise it gets called more than once.