Last Updated on
This post demonstrates how to change a newly created Angular project to use another @NgModule other than the default AppModule class.
- Angular CLI
- NPM 6.4.1
- Node v8.11.3
- Internet connection
Install Node and NPM first before Angular CLI.
Create a new Project
Next, invoke this command on the command-line prompt to create a new Angular project:
ng new practice
For this purpose, we just need to make a copy of the app folder and its contents. Then, modify the new files to point to the correct files within the same folder.
Modify main.ts to use the new @NgModule class in app2/app2.module.ts
If the project is currently served via ng serve, stop and start it.
We now load a new @NgModule.
Download the Files