This is a multipart training workshop, aimed at teaching you basic Angular design principles with ngrx.
We'll be using the following technologies in this workshop:
- Angular
- Angular CLI
- ngrx/store
- ngrx/effects
This workshop begins where the last workshop left off. If you haven't already, I recommend you complete the previous workshop before continuing: https://github.com/landmarkhw/training-redux-arch
Here's what we'll be trying to accomplish on in this training workshop:
- Add a user authentication dialog (e.g. login)
- Add a wait spinner for long-running actions
- Add form validation on the user authentication dialog
- Add a user registration dialog
- Clone this project:
git clone https://github.com/landmarkhw/training-angular-ngrx.git
- Checkout the "part1" branch:
git checkout part1
Run ng serve
for a dev server. Navigate to http://localhost:4200/
. The app will automatically reload if you change any of the source files.
I've added new actions and reducer for a new auth
section of the web site.
See auth.actions.ts
and auth.reducer.ts
Let's add a dialog that allows the user to enter their username/password and login to the system. We'll take these steps:
- Use the Angular CLI schematics to install the @angular/material library:
npm install --save @angular/material @angular/cdk @angular/animations
ng add @angular/material
- Import modules needed for
MatDialog
- Use the Angular CLI to create a
AuthenticationDialog
component:ng generate component components/authentication-dialog
- Create a form with username/password inputs and a "Sign In" button.
- Hook up the form submission to use the new
auth
actions to sign in. - Create selectors -
auth.selectors.ts
getIsAuthenticated()
getAuthenticatedDisplayName()
If you didn't complete part 1, you can checkout the "part2" branch to start where part 1 leaves off: git checkout part2
We didn't get to this during the training. I'll see if I can add it to the next training schedule.
We didn't get to this during the training. I'll see if I can add it to the next training schedule.
We didn't get to this during the training. I'll see if I can add it to the next training schedule.