Angular 7 Environment Setup

Here are the steps to set up your development environment for Angular 7:

  1. Install Node.js and npm (Node Package Manager) from https://nodejs.org/en/ if you haven't already.
  2. Open a command prompt or terminal window and run the following command to install the Angular CLI globally:
  3. npm install -g @angular/cli@7.0.0

    Note: Replace the version number (7.0.0) with the specific version of Angular 7 you want to install.

  4. Verify that the Angular CLI is installed correctly by running the following command:
  5. ng version
  6. Install a code editor. There are several options available, such as Visual Studio Code, WebStorm, or Sublime Text.
  7. Create a new Angular project by running the following command:
  8. ng new my-angular-app

    Note: Replace "my-angular-app" with the name of your project.

  9. Change into the project directory by running the following command:
  10. cd my-angular-app
  11. Start the development server by running the following command:
  12. ng serve --open

    Note: The "--open" flag will automatically open your default web browser and navigate to http://localhost:4200, which is where your Angular application will be running.

  13. You're all set! You can now start editing the files in the "src" directory and see your changes in real-time in your web browser.

Additional note:

If you are using Git to manage your code, it's recommended to create a .gitignore file in the root directory of your Angular project to exclude unnecessary files from being tracked by Git. A sample .gitignore file for Angular projects can be found at https://github.com/github/gitignore/blob/master/Node.gitignore

Next Article ❯