Basic commands to initialize your project in Angular:
- To create a new project, open your terminal and execute:
ng new project-name
- To execute your application and create the server project, execute the following commands:
ng serve
- Create a component:
ng g c /folder-name/component-name
- Create a module:
ng g m /folder-name/component-name
- Create an interface:
ng g interface /folder-name/interface-name
- Create a service:
ng g s /folder-service/service-name
- Install CLI:
npm i -g @angular/cli
If you want to deploy your Angular project locally or on GitPages, for example, execute:
ng build
This command allows you to generate a "bundle" of the entire project, in the format of HTML + Javascript + CSS files, to be published on any static server.
Observations:
- Services are not automatically imported into app.module.ts (unlike components).
- :host {} in the SCSS file modifies only that specific file.
Top comments (0)