Getting Started with Angular 4
Angular 4 Installation and Setup
JavaScript
is quickly becoming the go-to language for web developers. Front-end
web developers use JavaScript to add user interface enhancements, add
interactivity, and talk to back-end web services using AJAX. Web
developers who work on the server-side are also flocking to JavaScript
because of the efficiencies and speed offered by JavaScript’s
event-driven, non-blocking nature.
Installing Nodejs
1. We will start with downloading nodejs
2. Download the installer and complete the installation process.
3. Follow the prompts in the installer (Accept the license agreement, click the NEXT button a bunch of times and accept the default installation settings).
4. Restart your computer. You won’t be able to run Node.js® until you restart your computer.
5. Testing :
Node: To see if Node is installed, open the Windows Command Prompt, Powershell or a similar command line tool, and type
node -v
. This should print a version number, so you’ll see something like this v8.9.2
.
npm: To see if NPM is installed, type
npm -v
in Terminal. This should print NPM’s version number so you’ll see something like this 5.5.1
Installing Angular 4
We can install Angular 4 through CLI.
1. Execute command on command prompt:
$ npm install -g @angular/cli
2. To create new application:
$ ng new <project-name>
The Angular CLI makes it easy to create an application that already works.
3. Generate and Serve a project via a development server.
$ cd <project-name>
Navigate to
http://localhost:4200/
. The app will automatically reload if you change any of the source files.
You can read more information on angular commands on the following link:
Install VS Code for editing the code
- Download the Visual Studio Code installer for Windows.
- Once it is downloaded, run the installer (VSCodeSetup-version.exe). This will only take a minute.
- By default, VS Code is installed under
C:\Program Files\Microsoft VS Code
for a 64-bit machine.
How to Uninstall Node and NPM
You can uninstall Node.js and NPM the same as you would most Windows software:
- Open the Windows Control Panel
- Choose the “Programs and Features” option
- Click the “Uninstall a program” option
- Select Node.js, and click the Uninstall link.