First, we need to create a library for authentication so that if a new application wants to reuse it, it can just use our auth library and update it if required:
> ng g library auth
? In which directory should the library be generated?
? What framework should this library use? Angular [
https://angular.io/ ]
? Which stylesheet format would you like to use? SCSS [
http://sass-lang.com ]
? Which tags would you like to add to the library? (used for linting)
? Which Unit Test Runner would you like to use for the library? Jest
[https://jestjs.io/]
Now, let's include AuthModule in our es-admin application's AppModule:
import { AuthModule } from '@ngprojects/auth';
@NgModule({
...
imports: [
...
AuthModule,
],
...
})
export class AppModule {}
Now that our AuthModule has been scaffolded and added to the es-admin application, let's add the ngrx state to it for authentication.