Angular project using NgRx pattern to manage state of a system

users-management.component.html 718B

123456789101112131415161718192021222324
  1. <div class="p-4">
  2. <app-user-nav-bar></app-user-nav-bar>
  3. <ng-container *ngIf="userState$ | async as userState" [ngSwitch]="userState.dataState">
  4. <ng-container *ngSwitchCase="userStateEnum.INIT_STATE">
  5. <div class="p-2">initial state</div>
  6. </ng-container>
  7. <ng-container *ngSwitchCase="userStateEnum.LOADING">
  8. <div class="p-2">Data are looding ...</div>
  9. </ng-container>
  10. <ng-container *ngSwitchCase="userStateEnum.ERROR">
  11. <div class="p-2 text-danger"> {{userState.serverErrorMsg}} </div>
  12. </ng-container>
  13. <ng-container *ngSwitchCase="userStateEnum.LOADED">
  14. <app-users-list [inputState]="userState"></app-users-list>
  15. </ng-container>
  16. </ng-container>
  17. </div>

Powered by TurnKey Linux.