Với standalone component, route có thể dùng loadComponent; với feature có nhiều child routes, dùng loadChildren để import route array.
Ví dụ:
typescript
export const routes: Routes = [
{
path: "admin",
loadComponent: () => import("./admin/admin.page").then(m => m.AdminPage),
},
{
path: "settings",
loadChildren: () => import("./settings/routes").then(m => m.SETTINGS_ROUTES),
},
]Nên đặt boundary theo feature/screen thật sự, không tách quá nhỏ khiến waterfall request tăng.
With standalone components, use loadComponent; for a feature with many child routes, use loadChildren to import a route array.
Example:
typescript
export const routes: Routes = [
{
path: "admin",
loadComponent: () => import("./admin/admin.page").then(m => m.AdminPage),
},
{
path: "settings",
loadChildren: () => import("./settings/routes").then(m => m.SETTINGS_ROUTES),
},
]Set boundaries by real features/screens, not too small, otherwise request waterfalls increase.