Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Spring Boot and Angular

You're reading from   Spring Boot and Angular Hands-on full stack web development with Java, Spring, and Angular

Arrow left icon
Product type Paperback
Published in Dec 2022
Publisher Packt
ISBN-13 9781803243214
Length 438 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Seiji Ralph Villafranca Seiji Ralph Villafranca
Author Profile Icon Seiji Ralph Villafranca
Seiji Ralph Villafranca
Devlin Basilan Duldulao Devlin Basilan Duldulao
Author Profile Icon Devlin Basilan Duldulao
Devlin Basilan Duldulao
Arrow right icon
View More author details
Toc

Table of Contents (24) Chapters Close

Preface 1. Part 1: Overview of Spring Boot and Angular Development
2. Chapter 1: Spring Boot and Angular – The Big Picture FREE CHAPTER 3. Chapter 2: Setting Up the Development Environment 4. Part 2: Backend Development
5. Chapter 3: Moving into Spring Boot 6. Chapter 4: Setting Up the Database and Spring Data JPA 7. Chapter 5: Building APIs with Spring 8. Chapter 6: Documenting APIs with the OpenAPI Specification 9. Chapter 7: Adding Spring Boot Security with JWT 10. Chapter 8: Logging Events in Spring Boot 11. Chapter 9: Writing Tests in Spring Boot 12. Part 3: Frontend Development
13. Chapter 10: Setting Up Our Angular Project and Architecture 14. Chapter 11: Building Reactive Forms 15. Chapter 12: Managing States with NgRx 16. Chapter 13: Saving, Deleting, and Updating with NgRx 17. Chapter 14: Adding Authentication in Angular 18. Chapter 15: Writing Tests in Angular 19. Part 4: Deployment
20. Chapter 16: Packaging Backend and Frontend with Maven 21. Chapter 17: Deploying Spring Boot and the Angular App 22. Index 23. Other Books You May Enjoy

Writing an action

The first building block of state management is that we will write our actions. When writing actions, we have several rules we can follow so that we have good actions in our application:

  • Upfront: Writing actions should always come first before developing the features. This gives us an overview of what should be implemented in the application.
  • Divide: We should always categorize the actions based on the event source and the associated data.
  • Many: Writing more number actions is not an issue. It is more beneficial as more actions create a better overview of the flow of your application.
  • Event-Driven: Capture events as you separate the description of an event and how it’s handled.
  • Descriptive: Always provide meaningful information using type metadata. This helps debug the state.

Let’s look at an example action that will set the list of blogs in our state:

import { createAction, props } from '@ngrx/store';
export...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime