@@ -628,20 +628,16 @@ export const APP_ROUTES: Routes = [
628628 // ...
629629 {
630630 path: ' order-service' ,
631- children: ORDER_SERVICE_ROUTES ,
631+ loadChildren : () => import ( ' ordering-service ' ). then ( c => c . ORDER_SERVICE_ROUTES ) ,
632632 },
633633];
634634```
635635
636636``` typescript
637637// order-service.routes.ts
638638export const ORDER_SERVICE_ROUTES: Routes = [
639- {
640- path: ' ' ,
641- pathMatch: ' full' ,
642- component: RouterOutletComponent ,
643- },
644- { path: ' orders' , children: ORDER_ROUTES },
639+ { path: ' orders' , loadComponent : () => import (' ./order/order.component' ).then (c => c .OrderComponent ) },
640+ { path: ' **' , redirectTo: ' orders' }
645641];
646642```
647643
@@ -657,17 +653,16 @@ import { OrderDto, OrderService } from './proxy/ordering-service/services';
657653@Component ({
658654 selector: ' lib-order' ,
659655 templateUrl: ' ./order.component.html' ,
660- styleUrl: ' ./order.component.css'
656+ styleUrl: ' ./order.component.css' ,
661657 imports: [CommonModule ]
662658})
663659export class OrderComponent {
664660
665661 items: OrderDto [] = [];
666-
667- private readonly proxy = inject (OrderService );
662+ private readonly orderService = inject (OrderService );
668663
669664 constructor () {
670- this .proxy .getList ().subscribe ((res ) => {
665+ this .orderService .getList ().subscribe ((res ) => {
671666 this .items = res ;
672667 });
673668 }
@@ -686,11 +681,13 @@ export class OrderComponent {
686681 <th >Product Id</th >
687682 <th >Customer Name</th >
688683 </tr >
689- <tr *ngFor =" let item of items" >
690- <td >{%{{{item.id}}}%}</td >
691- <td >{%{{{item.productId}}}%}</td >
692- <td >{%{{{item.customerName}}}%}</td >
693- </tr >
684+ @for (item of items; track item.id) {
685+ <tr >
686+ <td >{%{{{item.id}}}%}</td >
687+ <td >{%{{{item.productId}}}%}</td >
688+ <td >{%{{{item.customerName}}}%}</td >
689+ </tr >
690+ }
694691 </thead >
695692 </table >
696693 </div >
0 commit comments