オプションのパラメーターを使用してルートを設定できますか (テンプレートとコントローラーは同じですが、存在しないパラメーターは無視する必要がありますか?
では、次の 2 つのルールを記述する代わりに、1 つだけにするのですか?
module.config(['$routeProvider', function($routeProvider) {
$routeProvider.
when('/users/', {templateUrl: 'template.tpl.html', controller: myCtrl}).
when('/users/:userId', {templateUrl: 'template.tpl.html', controller: myCtrl})
}]);
このようなもの([このパラメータはオプションです])
when('/users[/:userId]', {templateUrl: 'template.tpl.html', controller: myCtrl})
//note: this previous doesn't work
彼らのドキュメントには何も見つかりませんでした。