I am currently working on an editing application that utilizes AngularJS for the client side and Symfony 2 for the server side (I believe using Symfony is essential for solving my issue).
Therefore, my URL consists of two parts: - The Symfony part to access the editor - The Angular part to navigate within the editor
When a user saves their changes via AJAX, I want to update the Symfony part by adding a generated ID. To accomplish this, I manually construct the new route using the following JavaScript code snippet:
var newRoute = $location.protocol() + '://' + $location.host();
// Retrieve the Symfony route (using FOSJSRouting)
newRoute += Routing.generate('innova_path_editor', {workspaceId: EditorApp.workspaceId, pathId: EditorApp.pathId});
// Add the Angular part
newRoute += '#' + $location.path();
$location.url($location.hash(newRoute));
Although the generated route appears correct when printed in the console and functions correctly when copied and pasted into the browser, setting the URL with
$location.url($location.hash(newRoute));
causes Angular to redirect me to the 404 route.
Your assistance would be greatly appreciated.
EDIT
The generated route is:
http://localhost/Claroline/web/app_dev.php/innova_path/workspace/2/path/editor/37#/global
EDIT 2
If possible, I'd prefer to avoid reloading the page.