Zanex - Angular Admin & Dashboard Template

Creating a Component

The easiest way to create a component is with the Angular CLI. You can also create a component manually.


Creating a component using the Angular CLI

To create a component using the Angular CLI:

  1. From a terminal window, navigate to the directory containing your application
  2. Run the ng generate component <component-name> command, where <component-name> is the name of your new component.
ng generate component <component-name>
By default, this command creates the following:
  • A folder named after the component
  • A component file, <component-name>.component.ts
  • A template file, <component-name>.component.html
  • A CSS file, <component-name>.component.css
  • A testing specification file, <component-name>.component.spec.ts
Where <component-name> is the name of your component.

Creating a Module

The easiest way to create a module is with the Angular CLI. You can also create a module manually.


Creating a module using the Angular CLI

To create a module using the Angular CLI:

  1. From a terminal window, navigate to the directory containing your application
  2. Run the ng generate module <module-name> command, where <module-name> is the name of your new module.
ng generate module <module-name>
By default, this command creates the following:
  • A folder named after the module
  • A module file, <module-name>.module.ts
Where <module-name> is the name of your module.

Creating a Service

The easiest way to create a service is with the Angular CLI. You can also create a service manually.


Creating a service using the Angular CLI

To create a service using the Angular CLI:

  1. From a terminal window, navigate to the directory containing your application
  2. Run the ng generate service <service-name> command, where <service-name> is the name of your new service.
ng generate service <service-name>
By default, this command creates the following:
  • A folder named after the module
  • A service file, <service-name>.service.ts
Where <service-name> is the name of your service.