Sunday, April 16, 2023

Angular - Development Setup

ANgular development setup

Angular is a JavaScript framework for building web applications. It is maintained by Google and is widely used for creating dynamic single-page applications (SPAs) and complex user interfaces.

In the last post, we get a brief introduction to Angular. In this post, we will follow the steps to set up a development environment for Angular.

  1. Install Node.js and npm- Node.js is a runtime environment that allows you to run JavaScript code outside of a web browser. npm is a package manager for Node.js that allows you to install and manage packages and dependencies for your project. To install Node.js and npm, go to the official Node.js website and download the installer for your operating system. Once downloaded, run the installer and follow the on-screen instructions.
  2. Install Angular CLI- Angular CLI is a command-line interface tool that helps you create, manage, and deploy Angular projects. To install Angular CLI, open a terminal or command prompt and run the following command-
    npm install -g @angular/cli
  3. Create a new Angular project- To create a new one, open a terminal or command prompt and navigate to the directory where you want to create the project. Then, run the following command-
    ng new my-project
  4. Run Angular application- To run the Angular application, navigate to the project directory and run the following command-
    ng serve
    This command compiles and serves the Angular project on a local server. You can now open a web browser and navigate to http://localhost:4200 to see your Angular project in action.
  5. Install additional dependencies - Depending on your project requirements, you may need to install additional dependencies. To install a new dependency, open a terminal or command prompt and navigate to the project directory. Then, run the following command-
    npm install <package-name> --save
    Replace <package-name> with the package name you want to install.

No comments:

Post a Comment

^ Scroll to Top