May 2018
Intermediate to advanced
512 pages
11h 3m
English
So far, we have only worked with interfaces to represent data, and we still want to continue using interfaces when passing data around various components and services. However, there's a need to create a default object to initialize a BehaviorSubject. In Object-oriented Programming (OOP), it makes a lot of sense for the User object to own this functionality instead of a service. So, let's implement a User class to achieve this goal.
Inside the user/user folder, define an IUser interface and a User class provided in UserModule:
src/app/user/user/user.tsimport { Role } from '../../auth/role.enum'export interface IUser { id: string email: string name: { first: string middle: string last: string } picture: ...Read now
Unlock full access