209 похожих чатов

Привет всем! Кто-нибудь использует RouterModule, чтобы определять роуты для модулей? Например

отдельные роуты для админки импортируются в AdminModule с помощью RouterModule.register и все роуты с префиксом /admin, и то же самое с UserModule с префиксом /user? Чтобы разделять контроллеры для админки и пользователей..
Кто нибудь так делает, или есть мб получше решение?

Если так делаете, как быть с порядком регистрации роутов?
Если в RouterModule регистрируется роут с children,

{
path: "items",
module: ItemsModule,
children: [
{
path: "categories",
modules: ItemsCategoriesModule
}
]
}


И если в categories module есть контроллер с роутом "items/categories", а в items module есть "items/:id", то контроллер из categories module перезаписывается параметизированным роутом из items module, то есть запрос приходит на items/:id , где id = categories

Если кто-то с таким сталкивался или у кого-то есть получше решение, буду признателен любой помощи <3

5 ответов

12 просмотров

items/categories ставь выше items/:id При запросе сначала проверится первый, если эндпоинт не совпадёт - пойдёт на второй с id

Или вопрос про ангуляр вообще?

Wilson-Wilson 🦄 Автор вопроса
Дмитрий Могилевцев
items/categories ставь выше items/:id При запросе...

Они в разных классах и модулях находятся

Wilson-Wilson 🦄 Автор вопроса
Wilson Wilson 🦄
Они в разных классах и модулях находятся

Разве что попробовать из children убрать и в Routermodule прям вписать отдельный объект с path: "items/categories"

Похожие вопросы

Обсуждают сегодня

Since this HBAR page is so sensitive to words and criticism, I'll have to put this more delicately. What's up with this? DBS, a Hedera GC member holding $647 million in ETH?...
Summit Seeker R
10
What do you think they are trying to do ?
Ronan Gill
15
I am honored to report that all the deliverables for the BCHFAQ Flipstarter Phase 1 have been completed. I appreciate the opportunity I've had to put all this together using t...
fixthetracking
15
VIP-317 XVS bridge between Arbitrum one and BNB Chain, Ethereum and opBNB Summary Following the community proposal [VRC] Deploy Venus Protocol on Arbitrum, and the associate...
Venus Announcements
1
Based on the forum post on XPRT on basechain, I would like to express a few thoughts. In general, I think the idea that Persistence is pursuing is good, but I'm really having ...
Martin Knox
6
In trying to find a presentation from around 2021. Does this ring a bell? The presenter guy is on a stage in a video. He has a slide deck. The presentation is about preparing...
🗿len
16
I wonder about this, friends: Fet tokens will become asi tokens on the 11th of the month. Agix and ocean tokens will switch on the 13th. So, if the price of asi tokens goes up...
Oğuzhan
16
Is there any new news from Kadena? The price is very suppressed.
HAKAN TECİMEN
27
where FunToken might be headed next?
Josh
10
Hi everyone! I have a two-folded message to share today. First: updates and news, as we are being asked for those. We still want to go like we did the last 6 years: we w...
Marten | Unibright.io
31
Карта сайта