Learn Angular With PKR Studies

 Angular helps to create a reactive single-page application. 

The difference between Angular JS, Angular, and later versions.

Few commands to start with Angular
  1. node install - https://nodejs.org/en/download/
  2. npm install globally - "npm install -g @angular/cli"
  3. for creating a new application
    • please go inside the directory where you wish to create a project
    • run command - "ng new application_name"
If you want to dive deeper into the CLI and learn more about its usage, have a look at its official documentation: https://github.com/angular/angular-cli/wiki

Have you encountered issues during the installation of the CLI or setup of a new Angular project?
A lot of problems are solved by making sure you're using the latest version of NodeJS, npm, and the CLI itself.

Updating NodeJS:
Go to https://nodejs.org/en/download/ and download the latest version - uninstall (all) installed versions on your machine first.

Updating npm:
Run [sudo] npm install -g npm  (sudo is only required on Mac/ Linux)

Updating the CLI
Run the below commands sequentially
  • [sudo] npm uninstall -g angular-cli @angular/cli 
  • npm cache verify 
  • [sudo] npm install -g @angular/cli 

Here are some common issues & solutions:
Creation of a new project takes forever (longer than 3 minutes)
That happens on Windows from time to time => Try running the command line as an administrator

You get an EADDR error (Address already in use)
You might already have another ng serve process running - make sure to quit that or use ng serve --port <ANOTHERPORT>  to serve your project on a new port

My changes are not reflected in the browser (App is not compiling)
Check if the window running ng serve displays an error. If that's not the case, make sure you're using the latest CLI version and try restarting your CLI

Comments