As a newcomer to angularJS, I have been tasked with a project. I encountered an issue where calling an angular function on ng-click did not change the URL in the browser address bar. However, when I used pure JavaScript and called the function, it successfully changed the URL without reloading the page.
function pushAdd(page) {
window.history.pushState("", "", "/account/" + page);
}
Within the angular function, I call a JavaScript function named pushAdd. When I added an alert within the pushAdd() function, it displayed the correct page name, but the URL did not change.
$scope.changeUrl = function (page) {
/*my code which is working fine here*/
pushAdd(page);
}