4
angularjsルートにオプションのパラメーター値を指定できますか?
オプションのパラメーターを使用してルートを設定できますか(同じテンプレートとコントローラーですが、一部のパラメーターが存在しない場合は無視する必要がありますか? それで、次の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 ドキュメントには何も見つかりませんでした。