Angular 2 - 复杂的路由是Angular 2的痛点吗?

时间:2016-10-30 15:54:37

标签: angular

我正在考虑学习Angular2,但我发现一些提示,路由是一个痛点。具体来说,使用Angular 2似乎无法很好地处理复杂的URL路由。例如,我想做类似以下的事情:

/main/building/[building ID]/overview/ <-- changing the building ID goes to a different building
/main/building/[building ID]/room/[room ID]/ <-- Again, different room ID for different rooms in the same building
/main/building/[building ID/room/[room ID]/tickets/ <-- perhaps a list of tickets for a specific room from a specific building
/main/contacts/ <--- all our contacts
/main/contacts/[contact ID]/ <-- info about that contact
/main/contacts/[contact ID]/invoices/ <-- all the invoices sent to that contact
/main/contacts/[contact ID]/invoices/[invoice ID/ <--- detail of a specific invoice for a specific contact
/vendors/ <--- a list of all our vendors
/vendors/[vendor ID]/details <--- details about that specific vendor
/vendors/[vendor ID/tickets/ <--- all the tickets that *that* vendor has been assigned

所以,我想创建一些主要类别,例如mainmain/contacts以及vendors,这些类别还有其他子类别,例如main/building/和{ {1}}。我正在寻找一个包含大约8个主要部分的大型Web应用程序,每个部分都有多个子部分,每个那些都有更多的子部分。

稍微探讨了Angular 2,并特别研究了路由,似乎(从我已经阅读过的)来看,这是Angular 2的一个弱区。复杂的URL映射对Angular 2和结果,我一直犹豫要不要用它开始项目。

我错了吗?复杂的URL映射是否可行?这是一个巨大的头痛还是相对直接的?

0 个答案:

没有答案