Skip to content

Instantly share code, notes, and snippets.

@johnmakridis
Created December 19, 2023 18:49
Show Gist options
  • Save johnmakridis/7e0f6e770c0375583c17644c579c11e0 to your computer and use it in GitHub Desktop.
Save johnmakridis/7e0f6e770c0375583c17644c579c11e0 to your computer and use it in GitHub Desktop.
Steps to initialize a Angular project

Install Node.js

  • Download Node.js and install it in your machine
  • When installing on Windows machines, check the box related with Chocolatey
  • After installation, verify that Node.js is working on your machine by running:
    • node -v
    • npm -v

Get started with Angular

  • Install Angular CLI (this module contains the necessary code for running the ng commands, building your application, etc.)

    npm install -g @angular/cli

  • On Windows machines, if you're using Powershell as your terminal, run the following command (it is recommended to not use Powershell since it may be problematic)

    Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned

  • Go to a folder of your choice and run in your terminal the following command to generate the Angular project files:

    ng new your-app-name-here

    • Select SCSS in the prompt for stylesheet format
    • Select NO in the prompt for Server-Side Rendering (SSR)
    • Wait while Angular CLI creates the project's files and installs the required node modules
  • You are ready to run the project with the command:

    ng serve

    By default, the app will be accessible with your browser in address http://localhost:4200

Usefull commands

Generate components: ng generate component YourComponentNameHere

Build (compile) the project: ng build -c production

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment