My attempt to code an Angular Route for the controller to catch a parameter didn't go as planned.
Here is my configuration:
.config(function ($locationProvider) {
$locationProvider.html5Mode({
enabled: true,
requireBase: false
});
});
.config(function ($routeProvider) {
$routeProvider.when('/products/insert/:id', {
controller: 'ProductInsertCtrl'
});
})
During testing:
$rootScope.$on('$locationChangeSuccess', function () {
console.log($route.current.params, $routeParams);
});
The result I got was:
Object {}, undefined
This discrepancy between $route.current.params and $routeParams has left me puzzled. Can someone explain why this is happening?