Generating router-enabled modules
Now that we have our high-level components defined as Manager, Inventory, and POS, we can define them as modules. These modules will be different from the ones you’ve created for routing and Angular Material. We can create the user profile as a component on the app module; however, note that the user profile will only ever be used for already-authenticated users, so it makes sense to define a fourth module only meant for authenticated users in general. This way, you will ensure that your app’s first payload remains as minimal as possible. In addition, we will create a home
component to contain the landing experience for our app so that we can keep implementation details out of app.component
:
- Generate
manager
,inventory
,pos
, anduser
feature modules by specifying their names and routing capabilities:$ npx ng g m manager --routing $ npx ng g m inventory --routing $ npx ng g m pos --routing $ npx ng g m user --routing...