Put in order · Angular course · Module 9: HttpClient
Resource States in a @switch Template
Order the template blocks that handle resource() states in this order: switch header, loading, error, success:
Items to put in order
- @case ('error') { {{ samuraiResource.error() }} }
- @case ('success') { {{ samuraiResource.value() }} }
- @switch (samuraiResource.status()) {
- @case ('loading') { <app-spinner /> }
- }
You can check the correct answer by solving this task in the CodeWorlds game.