-1
prefix/foo-bar-1123
、prefix/foo-bar-1123/bazquux-123
、角4ルータでこれらの種類のURLを使用する方法を使用しますか?重要なビットは、私がキャプチャしようとしている数値のIDです。角4のルータのURLでルータパラメータを使用する
私はこれを試しましたが、その結果、categorySlug-:categoryId
とsubcategorySlug-:subcategoryId
という単一の変数に取り込まれた// charactersedのデータがすべて取得されています。
const routes = [{
path: 'prefix/:categorySlug-:categoryId',
component: MyComponent,
}, {
path: 'prefix/:categorySlug-:categoryId/:subcategorySlug-:subcategoryId',
component: MyComponent,
}]
export const MyRoute: ModuleWithProviders = RouterModule.forChild(routes)
最終的に私は、変数のこれらの種類で終わるしたいと思います:
categorySlug=foo-bar
categoryId=1123
subcategorySlug=bazquux
subcategoryId=123
これはルータがサポートする何かですか?これらをサポートするためにルータを拡張することは可能ですか?