I am facing an issue where Angular is unable to find the content on valid links and returns a 404 error. Below is the configuration of the routes:
$routeProvider.when('/', {templateUrl: 'partials/home.html'});
$routeProvider.when('/home', {templateUrl: 'partials/home.html'});
$routeProvider.when('/menus', {templateUrl: 'partials/menus.html'});
$routeProvider.when('/menu/:menuId', {templateUrl: 'partials/menu.html', controller: 'ShowMenuCtrl'});
$routeProvider.when('/products', {templateUrl: 'partials/products.html'});
$routeProvider.when('/product/:productId', {templateUrl: 'partials/product.html', controller: 'ShowProductCtrl'});
$routeProvider.when('/drink/:productId', {templateUrl: 'partials/product.html', controller: 'ShowProductCtrl'});
$routeProvider.when('/drinks', {templateUrl: 'partials/drinks.html'});
$routeProvider.when('/order', {templateUrl: 'partials/order.html'});
$routeProvider.when('/404', {templateUrl: 'partials/404.html'});
$routeProvider.otherwise({redirectTo: '/404'});
For instance, a link (
<a href="#/menu/{[{menu.id}]}" translate >SEE</a>
) pointing to /menu/45122245 works in /menus/ view but not in /home/ (leading to a 404 error).
Despite using the same URL and object with the same ID, I am unsure of what could be causing this issue. If you require any additional code or information, please let me know :)