May 2018
Intermediate to advanced
512 pages
11h 3m
English
We will start by creating an auth service with a real and a fake login provider:
$ npx ng g s auth -m app --flat false
src/app/app.module.tsimport { AuthService } from './auth/auth.service'... providers: [AuthService],
Creating a separate folder for the service will organize various related components to authentication and authorization, such as the enum definition for Role. Additionally, we will be able to add an authService fake to the same folder, essential for writing unit tests.
src/app/auth/role.enum.tsexport enum Role { None = 'none', Clerk = 'clerk', Cashier = 'cashier', Manager = ...Read now
Unlock full access