Skip to content

Commit 2daadf8

Browse files
Merge pull request #24132 from abpframework/updating-the-microservice-tutorial
Updating the microservice tutorial
2 parents 693aa8b + 57bda35 commit 2daadf8

File tree

2 files changed

+20
-21
lines changed

2 files changed

+20
-21
lines changed

docs/en/tutorials/microservice/part-05.md

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -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
638638
export 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
})
663659
export 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>

docs/en/tutorials/microservice/part-06.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,13 @@ Open the `order.component.html` file (the `order.component.html` file under the
314314
<th>Product Name</th>
315315
<th>Customer Name</th>
316316
</tr>
317-
<tr *ngFor="let item of items">
318-
<td>{%{{{item.id}}}%}</td>
319-
<td>{%{{{item.productName}}}%}</td>
320-
<td>{%{{{item.customerName}}}%}</td>
321-
</tr>
317+
@for (item of items; track item.id) {
318+
<tr>
319+
<td>{%{{{item.id}}}%}</td>
320+
<td>{%{{{item.productName}}}%}</td>
321+
<td>{%{{{item.customerName}}}%}</td>
322+
</tr>
323+
}
322324
</thead>
323325
</table>
324326
</div>

0 commit comments

Comments
 (0)