Here you will see how to create new AngularJS project on Windows environment. We will use node.js and npm for setting up the new AngularJS project on Windows environment.
Please make sure you have npm and node.js setup on Windows system before you proceed further.
Please make sure you are running at least Node.js version 8.x or greater and npm version 5.x. You can check the version by running node -v and npm -v in a console(cmd) window.
Please go through the following steps in order to how to create new AngularJS project on Windows.
Step 1. Open your cmd window and execute the following command. This will install Angular CLI globally.
npm install -g @angular/cli
Step 2. Once the setup is successfully finished using the command at step 1, now create a new project at any directory as you wish. Navigate to the desired directory and execute the following command.
ng new angularjs-app
In the above command ng new is required to create new Angular application and angularjs-app is the AngularJS application directory.
Wait for few minutes to download all the required packages under your new project directory angularjs-app.
Step 3. Run the application by executing the following command. First navigate to the angularjs-app directory in cmd window then execute the following command.
ng serve --open
The ng serve command launches the server, watches your files, and rebuilds the app as you make changes to those files.
Using the –open (or just -o) option automatically opens your browser on http://localhost:4200/
Now you will see similar to the following image on your browser:
Congratulations! You have got idea how to create AngularJS project on Windows environment.
You can edit your src/app/app.component.ts file and change your title. You can also edit src/app/app.component.css and give some style to your AngularJS application.
Thanks for reading.Tags: node • node.js • npm