Can I set a route with optional params (same template and controller, but some params should be ignored if they don\'t exist?
So instead of writing the following two
Like @g-eorge mention, you can make it like this:
module.config(['$routeProvider', function($routeProvider) { $routeProvider. when('/users/:userId?', {templateUrl: 'template.tpl.html', controller: myCtrl}) }]);
You can also make as much as u need optional parameters.