Whenever I attempt to change the path of my angular app, about 1 out of every 10 tries results in a routing crash. To clarify, by "crash" I mean that the route changes to the new path, but simultaneously the URL loses the '#'
The controller function triggered after clicking on an HTML div with ng-click:
$scope.showDetailOfEntry = function(id){
$location.path('/detail/' + id);
}
The defined routing:
.when('/detail/:id', {
title: "Detail-View",
name: "detail",
templateUrl: "./templates/detail.php",
controller: "DetailController"
})
About 9/10 times, the path change occurs smoothly without any issue.
The expected URL should be:
http://localhost/MyApp/#/detail/66
However, it ends up as:
http://localhost/MyApp/detail/66
I suspect the problem lies within the $location.path();
function - perhaps there are occasional timing conflicts.
Any insights into why this sporadic issue is occurring would be greatly appreciated. Thank you for your support!