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 so far, for routing and Angular Material. We can create the user profile as a component on the app module; however, note that 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
modules, specifying their target module and routing capabilities:$ npx ng g m manager -m app --routing $ npx ng g m inventory -m app --routing $ npx ng g m pos -m app --routing...