Create New Page
To create a page, we need to create routes and components, and write some import lines in a few files. Fortunately, Angular provides commands to automate this task. In this guide, we will see how to use them.
Creating a Standalone Component
First, navigate to the app/pages folder and create a suitable folder name for your page. For example, if you are creating an authentication page, you might name it auth.
Now, open that folder in the terminal and execute the following command:
ng generate component component_name
This will create a folder with the name component_name, inside which the following files will be generated: component_name.component.ts, component_name.component.html, component_name.component.scss, and component_name.component.spec.ts (for testing).
Create a route file for that component. Add a new file in component_name named with component_name.routes.ts
Info: You can make Angular skip creating spec.ts file while creating a component by using this command:
ng generate component component_name --skip-tests